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

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

Issue 7737001: content: Start splitting up chrome/browser/ui/gtk/gtk_util.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/gtk/external_protocol_dialog_gtk.h" 5 #include "chrome/browser/ui/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
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/external_protocol/external_protocol_handler.h" 15 #include "chrome/browser/external_protocol/external_protocol_handler.h"
16 #include "chrome/browser/tab_contents/tab_util.h" 16 #include "chrome/browser/tab_contents/tab_util.h"
17 #include "chrome/browser/ui/gtk/gtk_util.h" 17 #include "chrome/browser/ui/gtk/gtk_util.h"
18 #include "grit/chromium_strings.h" 18 #include "grit/chromium_strings.h"
19 #include "grit/generated_resources.h" 19 #include "grit/generated_resources.h"
20 #include "ui/base/gtk/gtk_hig_constants.h"
20 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
21 #include "ui/base/text/text_elider.h" 22 #include "ui/base/text/text_elider.h"
22 23
23 namespace { 24 namespace {
24 25
25 const int kMessageWidth = 400; 26 const int kMessageWidth = 400;
26 27
27 } // namespace 28 } // namespace
28 29
29 /////////////////////////////////////////////////////////////////////////////// 30 ///////////////////////////////////////////////////////////////////////////////
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 IDS_EXTERNAL_PROTOCOL_INFORMATION, 73 IDS_EXTERNAL_PROTOCOL_INFORMATION,
73 ASCIIToUTF16(url.scheme() + ":"), 74 ASCIIToUTF16(url.scheme() + ":"),
74 elided_url_without_scheme) + "\n\n"; 75 elided_url_without_scheme) + "\n\n";
75 76
76 message_text += l10n_util::GetStringFUTF8( 77 message_text += l10n_util::GetStringFUTF8(
77 IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH, elided_command) + "\n\n"; 78 IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH, elided_command) + "\n\n";
78 79
79 message_text += l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_WARNING); 80 message_text += l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_WARNING);
80 81
81 // Create the content-holding vbox. 82 // Create the content-holding vbox.
82 GtkWidget* vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); 83 GtkWidget* vbox = gtk_vbox_new(FALSE, ui::kControlSpacing);
83 gtk_container_set_border_width(GTK_CONTAINER(vbox), 84 gtk_container_set_border_width(GTK_CONTAINER(vbox),
84 gtk_util::kContentAreaBorder); 85 ui::kContentAreaBorder);
85 86
86 // Add the message text. 87 // Add the message text.
87 GtkWidget* label = gtk_label_new(message_text.c_str()); 88 GtkWidget* label = gtk_label_new(message_text.c_str());
88 gtk_util::SetLabelWidth(label, kMessageWidth); 89 gtk_util::SetLabelWidth(label, kMessageWidth);
89 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); 90 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
90 91
91 // Add the checkbox. 92 // Add the checkbox.
92 checkbox_ = gtk_check_button_new_with_label( 93 checkbox_ = gtk_check_button_new_with_label(
93 l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT).c_str()); 94 l10n_util::GetStringUTF8(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT).c_str());
94 gtk_box_pack_start(GTK_BOX(vbox), checkbox_, 95 gtk_box_pack_start(GTK_BOX(vbox), checkbox_,
(...skipping 28 matching lines...) Expand all
123 if (response_id == GTK_RESPONSE_ACCEPT) { 124 if (response_id == GTK_RESPONSE_ACCEPT) {
124 UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url", 125 UMA_HISTOGRAM_LONG_TIMES("clickjacking.launch_url",
125 base::TimeTicks::Now() - creation_time_); 126 base::TimeTicks::Now() - creation_time_);
126 127
127 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_); 128 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url_);
128 } 129 }
129 130
130 gtk_widget_destroy(dialog_); 131 gtk_widget_destroy(dialog_);
131 delete this; 132 delete this;
132 } 133 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc ('k') | chrome/browser/ui/gtk/find_bar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698