OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/instant/instant_confirm_dialog.h" | 5 #include "chrome/browser/instant/instant_confirm_dialog.h" |
6 | 6 |
| 7 #include "app/l10n_util.h" |
7 #include "chrome/browser/instant/instant_controller.h" | 8 #include "chrome/browser/instant/instant_controller.h" |
8 #include "chrome/browser/instant/promo_counter.h" | 9 #include "chrome/browser/instant/promo_counter.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "grit/generated_resources.h" |
12 | 14 |
13 namespace browser { | 15 namespace browser { |
14 | 16 |
15 const char kInstantLearnMoreURL[] = | 17 std::string InstantLearnMoreURL() { |
16 "http://www.google.com/support/chrome/bin/answer.py?answer=180655"; | 18 return l10n_util::GetStringUTF8(IDS_INSTANT_LEARN_MORE_URL); |
| 19 } |
17 | 20 |
18 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, | 21 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, |
19 Profile* profile) { | 22 Profile* profile) { |
20 PrefService* prefs = profile->GetPrefs(); | 23 PrefService* prefs = profile->GetPrefs(); |
21 if (!prefs) | 24 if (!prefs) |
22 return; | 25 return; |
23 | 26 |
24 PromoCounter* promo_counter = profile->GetInstantPromoCounter(); | 27 PromoCounter* promo_counter = profile->GetInstantPromoCounter(); |
25 if (promo_counter) | 28 if (promo_counter) |
26 promo_counter->Hide(); | 29 promo_counter->Hide(); |
27 | 30 |
28 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { | 31 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { |
29 InstantController::Enable(profile); | 32 InstantController::Enable(profile); |
30 return; | 33 return; |
31 } | 34 } |
32 | 35 |
33 ShowInstantConfirmDialog(parent, profile); | 36 ShowInstantConfirmDialog(parent, profile); |
34 } | 37 } |
35 | 38 |
36 } // namespace browser | 39 } // namespace browser |
OLD | NEW |