<commit_before>// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/instant/instant_confirm_dialog.h"

#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/instant/promo_counter.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"

namespace browser {

// TODO: get the right url.
const char kInstantLearnMoreURL[] = "http://www.google.com";

void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent,
                                         Profile* profile) {
  PrefService* prefs = profile->GetPrefs();
  if (!prefs)
    return;

  PromoCounter* promo_counter = profile->GetInstantPromoCounter();
  if (promo_counter)
    promo_counter->Hide();

  if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) {
    InstantController::Enable(profile);
    return;
  }

  ShowInstantConfirmDialog(parent, profile);
}

}  // namespace browser<commit_msg>Instant: use the correct link for learn more.<commit_after>// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/instant/instant_confirm_dialog.h"

#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/instant/promo_counter.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"

namespace browser {

const char kInstantLearnMoreURL[] =
    "http://www.google.com/support/chrome/bin/answer.py?answer=180655";

void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent,
                                         Profile* profile) {
  PrefService* prefs = profile->GetPrefs();
  if (!prefs)
    return;

  PromoCounter* promo_counter = profile->GetInstantPromoCounter();
  if (promo_counter)
    promo_counter->Hide();

  if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) {
    InstantController::Enable(profile);
    return;
  }

  ShowInstantConfirmDialog(parent, profile);
}

}  // namespace browser
{'fraction_non_alphanumeric': 0.11502864698104892, 'fraction_numerical': 0.00617011899515205, 'mean_word_length': 4.147392290249433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2759969', 'n_tokens_mistral': 718, 'n_tokens_neox': 681, 'n_words': 155}