Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/instant/instant_confirm_dialog.cc

Issue 5023001: Handful of related instant changes: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux build Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
8 #include "chrome/browser/instant/promo_counter.h"
7 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
9 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
10 12
11 namespace browser { 13 namespace browser {
12 14
13 // TODO: get the right url. 15 // TODO: get the right url.
14 const char kInstantLearnMoreURL[] = "http://www.google.com"; 16 const char kInstantLearnMoreURL[] = "http://www.google.com";
15 17
16 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent, 18 void ShowInstantConfirmDialogIfNecessary(gfx::NativeWindow parent,
17 Profile* profile) { 19 Profile* profile) {
18 PrefService* prefs = profile->GetPrefs(); 20 PrefService* prefs = profile->GetPrefs();
19 if (!prefs) 21 if (!prefs)
20 return; 22 return;
21 23
24 PromoCounter* promo_counter = profile->GetInstantPromoCounter();
25 if (promo_counter)
26 promo_counter->Hide();
27
22 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) { 28 if (prefs->GetBoolean(prefs::kInstantConfirmDialogShown)) {
23 prefs->SetBoolean(prefs::kInstantEnabled, true); 29 InstantController::Enable(profile);
24 return; 30 return;
25 } 31 }
26 32
27 ShowInstantConfirmDialog(parent, profile); 33 ShowInstantConfirmDialog(parent, profile);
28 } 34 }
29 35
30 #if !defined(TOOLKIT_VIEWS) && !defined(TOOLKIT_GTK) 36 #if !defined(TOOLKIT_VIEWS) && !defined(TOOLKIT_GTK)
31 void ShowInstantConfirmDialog(gfx::NativeWindow parent, 37 void ShowInstantConfirmDialog(gfx::NativeWindow parent,
32 Profile* profile) { 38 Profile* profile) {
33 NOTIMPLEMENTED(); 39 NOTIMPLEMENTED();
34 } 40 }
35 #endif 41 #endif
36 42
37 } // namespace browser 43 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_confirm_dialog.h ('k') | chrome/browser/instant/instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698