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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 267103002: Ignore title parameter for navigator.registerProtocolHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/content_settings/content_setting_bubble_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 if (pending_handler_.protocol() == "mailto") { 1024 if (pending_handler_.protocol() == "mailto") {
1025 protocol = l10n_util::GetStringUTF16( 1025 protocol = l10n_util::GetStringUTF16(
1026 IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME); 1026 IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME);
1027 } else if (pending_handler_.protocol() == "webcal") { 1027 } else if (pending_handler_.protocol() == "webcal") {
1028 protocol = l10n_util::GetStringUTF16( 1028 protocol = l10n_util::GetStringUTF16(
1029 IDS_REGISTER_PROTOCOL_HANDLER_WEBCAL_NAME); 1029 IDS_REGISTER_PROTOCOL_HANDLER_WEBCAL_NAME);
1030 } else { 1030 } else {
1031 protocol = base::UTF8ToUTF16(pending_handler_.protocol()); 1031 protocol = base::UTF8ToUTF16(pending_handler_.protocol());
1032 } 1032 }
1033 1033
1034 // Note that we ignore the |title| parameter.
1034 if (previous_handler_.IsEmpty()) { 1035 if (previous_handler_.IsEmpty()) {
1035 set_title(l10n_util::GetStringFUTF8( 1036 set_title(l10n_util::GetStringFUTF8(
1036 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM, 1037 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM,
1037 pending_handler_.title(),
1038 base::UTF8ToUTF16(pending_handler_.url().host()), 1038 base::UTF8ToUTF16(pending_handler_.url().host()),
1039 protocol)); 1039 protocol));
1040 } else { 1040 } else {
1041 set_title(l10n_util::GetStringFUTF8( 1041 set_title(l10n_util::GetStringFUTF8(
1042 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM_REPLACE, 1042 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM_REPLACE,
1043 pending_handler_.title(),
1044 base::UTF8ToUTF16(pending_handler_.url().host()), 1043 base::UTF8ToUTF16(pending_handler_.url().host()),
1045 protocol, previous_handler_.title())); 1044 protocol,
1045 base::UTF8ToUTF16(previous_handler_.url().host())));
1046 } 1046 }
1047 1047
1048 std::string radio_allow_label = 1048 std::string radio_allow_label =
1049 l10n_util::GetStringFUTF8(IDS_REGISTER_PROTOCOL_HANDLER_ACCEPT, 1049 l10n_util::GetStringUTF8(IDS_REGISTER_PROTOCOL_HANDLER_ACCEPT);
1050 pending_handler_.title());
1051 std::string radio_deny_label = 1050 std::string radio_deny_label =
1052 l10n_util::GetStringUTF8(IDS_REGISTER_PROTOCOL_HANDLER_DENY); 1051 l10n_util::GetStringUTF8(IDS_REGISTER_PROTOCOL_HANDLER_DENY);
1053 std::string radio_ignore_label = 1052 std::string radio_ignore_label =
1054 l10n_util::GetStringUTF8(IDS_REGISTER_PROTOCOL_HANDLER_IGNORE); 1053 l10n_util::GetStringUTF8(IDS_REGISTER_PROTOCOL_HANDLER_IGNORE);
1055 1054
1056 GURL url = web_contents->GetURL(); 1055 GURL url = web_contents->GetURL();
1057 RadioGroup radio_group; 1056 RadioGroup radio_group;
1058 radio_group.url = url; 1057 radio_group.url = url;
1059 1058
1060 radio_group.radio_items.push_back(radio_allow_label); 1059 radio_group.radio_items.push_back(radio_allow_label);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { 1306 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) {
1308 DCHECK_EQ(web_contents_, 1307 DCHECK_EQ(web_contents_,
1309 content::Source<WebContents>(source).ptr()); 1308 content::Source<WebContents>(source).ptr());
1310 web_contents_ = NULL; 1309 web_contents_ = NULL;
1311 } else { 1310 } else {
1312 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); 1311 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
1313 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); 1312 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
1314 profile_ = NULL; 1313 profile_ = NULL;
1315 } 1314 }
1316 } 1315 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698