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

Side by Side Diff: chrome/browser/gtk/instant_confirm_dialog_gtk.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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/gtk/options/general_page_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gtk/instant_confirm_dialog_gtk.h" 5 #include "chrome/browser/gtk/instant_confirm_dialog_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "chrome/browser/gtk/gtk_chrome_link_button.h" 10 #include "chrome/browser/gtk/gtk_chrome_link_button.h"
11 #include "chrome/browser/gtk/gtk_util.h" 11 #include "chrome/browser/gtk/gtk_util.h"
12 #include "chrome/browser/instant/instant_confirm_dialog.h" 12 #include "chrome/browser/instant/instant_confirm_dialog.h"
13 #include "chrome/browser/prefs/pref_service.h" 13 #include "chrome/browser/instant/instant_controller.h"
14 #include "chrome/browser/profile.h" 14 #include "chrome/browser/profile.h"
15 #include "chrome/browser/show_options_url.h" 15 #include "chrome/browser/show_options_url.h"
16 #include "chrome/common/pref_names.h"
17 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
18 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
19 18
20 namespace browser { 19 namespace browser {
21 20
22 void ShowInstantConfirmDialog(GtkWindow* parent, Profile* profile) { 21 void ShowInstantConfirmDialog(GtkWindow* parent, Profile* profile) {
23 new InstantConfirmDialogGtk(parent, profile); 22 new InstantConfirmDialogGtk(parent, profile);
24 } 23 }
25 24
26 } // namespace browser 25 } // namespace browser
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); 58 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT);
60 gtk_widget_show_all(dialog_); 59 gtk_widget_show_all(dialog_);
61 } 60 }
62 61
63 InstantConfirmDialogGtk::~InstantConfirmDialogGtk() { 62 InstantConfirmDialogGtk::~InstantConfirmDialogGtk() {
64 gtk_widget_destroy(dialog_); 63 gtk_widget_destroy(dialog_);
65 } 64 }
66 65
67 void InstantConfirmDialogGtk::OnDialogResponse(GtkWidget* dialog, 66 void InstantConfirmDialogGtk::OnDialogResponse(GtkWidget* dialog,
68 int response) { 67 int response) {
69 if (response == GTK_RESPONSE_ACCEPT) { 68 if (response == GTK_RESPONSE_ACCEPT)
70 PrefService* service = profile_->GetPrefs(); 69 InstantController::Enable(profile_);
71 if (service) {
72 service->SetBoolean(prefs::kInstantEnabled, true);
73 service->SetBoolean(prefs::kInstantConfirmDialogShown, true);
74 }
75 }
76 70
77 delete this; 71 delete this;
78 } 72 }
79 73
80 void InstantConfirmDialogGtk::OnLinkButtonClicked(GtkWidget* button) { 74 void InstantConfirmDialogGtk::OnLinkButtonClicked(GtkWidget* button) {
81 browser::ShowOptionsURL(profile_, GURL(browser::kInstantLearnMoreURL)); 75 browser::ShowOptionsURL(profile_, GURL(browser::kInstantLearnMoreURL));
82 } 76 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/gtk/options/general_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698