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

Side by Side Diff: chrome/browser/gtk/external_protocol_dialog_gtk.cc

Issue 1118005: GTK: More transitions to thunk definition macros. (Closed)
Patch Set: Created 10 years, 9 months 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/external_protocol_dialog_gtk.h" 5 #include "chrome/browser/gtk/external_protocol_dialog_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), vbox, 91 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), vbox,
92 FALSE, FALSE, 0); 92 FALSE, FALSE, 0);
93 93
94 g_signal_connect(dialog_, "response", 94 g_signal_connect(dialog_, "response",
95 G_CALLBACK(OnDialogResponseThunk), this); 95 G_CALLBACK(OnDialogResponseThunk), this);
96 96
97 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); 97 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);
98 gtk_widget_show_all(dialog_); 98 gtk_widget_show_all(dialog_);
99 } 99 }
100 100
101 void ExternalProtocolDialogGtk::OnDialogResponse(int response) { 101 void ExternalProtocolDialogGtk::OnDialogResponse(GtkWidget* widget,
102 int response) {
102 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_))) { 103 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox_))) {
103 if (response == GTK_RESPONSE_ACCEPT) { 104 if (response == GTK_RESPONSE_ACCEPT) {
104 ExternalProtocolHandler::SetBlockState( 105 ExternalProtocolHandler::SetBlockState(
105 UTF8ToWide(url_.scheme()), ExternalProtocolHandler::DONT_BLOCK); 106 UTF8ToWide(url_.scheme()), ExternalProtocolHandler::DONT_BLOCK);
106 } else if (response == GTK_RESPONSE_REJECT) { 107 } else if (response == GTK_RESPONSE_REJECT) {
107 ExternalProtocolHandler::SetBlockState( 108 ExternalProtocolHandler::SetBlockState(
108 UTF8ToWide(url_.scheme()), ExternalProtocolHandler::BLOCK); 109 UTF8ToWide(url_.scheme()), ExternalProtocolHandler::BLOCK);
109 } 110 }
110 // If the response is GTK_RESPONSE_DELETE, triggered by the user closing 111 // If the response is GTK_RESPONSE_DELETE, triggered by the user closing
111 // the dialog, do nothing. 112 // the dialog, do nothing.
112 } 113 }
113 114
114 if (response == GTK_RESPONSE_ACCEPT) { 115 if (response == GTK_RESPONSE_ACCEPT) {
115 UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url", 116 UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url",
116 base::Time::Now() - creation_time_); 117 base::Time::Now() - creation_time_);
117 118
118 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_); 119 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_);
119 } 120 }
120 121
121 gtk_widget_destroy(dialog_); 122 gtk_widget_destroy(dialog_);
122 delete this; 123 delete this;
123 } 124 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/external_protocol_dialog_gtk.h ('k') | chrome/browser/tab_contents/tab_contents_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698