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 "googleurl/src/gurl.h" |
| 14 #include "grit/generated_resources.h" |
12 | 15 |
13 namespace browser { | 16 namespace browser { |
14 | 17 |
15 const char kInstantLearnMoreURL[] = | 18 GURL InstantLearnMoreURL() { |
16 "http://www.google.com/support/chrome/bin/answer.py?answer=180655"; | 19 return GURL(l10n_util::GetStringUTF8(IDS_INSTANT_LEARN_MORE_URL)); |
| 20 } |
17 | 21 |
18 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, | 22 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, |
19 Profile* profile) { | 23 Profile* profile) { |
20 PrefService* prefs = profile->GetPrefs(); | 24 PrefService* prefs = profile->GetPrefs(); |
21 if (!prefs) | 25 if (!prefs) |
22 return; | 26 return; |
23 | 27 |
24 PromoCounter* promo_counter = profile->GetInstantPromoCounter(); | 28 PromoCounter* promo_counter = profile->GetInstantPromoCounter(); |
25 if (promo_counter) | 29 if (promo_counter) |
26 promo_counter->Hide(); | 30 promo_counter->Hide(); |
27 | 31 |
28 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { | 32 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { |
29 InstantController::Enable(profile); | 33 InstantController::Enable(profile); |
30 return; | 34 return; |
31 } | 35 } |
32 | 36 |
33 ShowInstantConfirmDialog(parent, profile); | 37 ShowInstantConfirmDialog(parent, profile); |
34 } | 38 } |
35 | 39 |
36 } // namespace browser | 40 } // namespace browser |
OLD | NEW |