| 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 "chrome/browser/instant/instant_controller.h" | 7 #include "chrome/browser/instant/instant_controller.h" |
| 8 #include "chrome/browser/instant/promo_counter.h" | 8 #include "chrome/browser/instant/promo_counter.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 | 12 |
| 13 namespace browser { | 13 namespace browser { |
| 14 | 14 |
| 15 // TODO: get the right url. | 15 // TODO: get the right url. |
| 16 const char kInstantLearnMoreURL[] = "http://www.google.com"; | 16 const char kInstantLearnMoreURL[] = "http://www.google.com"; |
| 17 | 17 |
| 18 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, | 18 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, |
| 19 Profile* profile) { | 19 Profile* profile) { |
| 20 PrefService* prefs = profile->GetPrefs(); | 20 PrefService* prefs = profile->GetPrefs(); |
| 21 if (!prefs) | 21 if (!prefs) |
| 22 return; | 22 return; |
| 23 | 23 |
| 24 PromoCounter* promo_counter = profile->GetInstantPromoCounter(); | 24 PromoCounter* promo_counter = profile->GetInstantPromoCounter(); |
| 25 if (promo_counter) | 25 if (promo_counter) |
| 26 promo_counter->Hide(); | 26 promo_counter->Hide(); |
| 27 | 27 |
| 28 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { | 28 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { |
| 29 InstantController::Enable(profile); | 29 InstantController::Enable(profile); |
| 30 return; | 30 return; |
| 31 } | 31 } |
| 32 | 32 |
| 33 ShowInstantConfirmDialog(parent, profile); | 33 ShowInstantConfirmDialog(parent, profile); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace browser | 36 } // namespace browser |
| OLD | NEW |