Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 : ContentSettingBubbleModel(web_contents, profile, content_type), | 101 : ContentSettingBubbleModel(web_contents, profile, content_type), |
| 102 delegate_(delegate) { | 102 delegate_(delegate) { |
| 103 // Notifications do not have a bubble. | 103 // Notifications do not have a bubble. |
| 104 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); | 104 DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); |
| 105 SetTitle(); | 105 SetTitle(); |
| 106 SetManageLink(); | 106 SetManageLink(); |
| 107 SetLearnMoreLink(); | 107 SetLearnMoreLink(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ContentSettingTitleAndLinkModel::SetTitle() { | 110 void ContentSettingTitleAndLinkModel::SetTitle() { |
| 111 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS && | |
| 112 TabSpecificContentSettings::FromWebContents(web_contents()) | |
|
Lei Zhang
2014/12/05 22:18:05
If you save the return value, you can then call it
Will Harris
2014/12/08 00:21:11
Ack. restructured this and also checked for non NU
| |
| 113 ->IsContentBlocked(content_type())) { | |
| 114 const base::string16 plugin_names = | |
| 115 TabSpecificContentSettings::FromWebContents(web_contents()) | |
| 116 ->blocked_plugin_names(); | |
| 117 if (!plugin_names.empty()) { | |
| 118 set_plugin_names(plugin_names); | |
| 119 } | |
| 120 } | |
| 121 | |
| 111 static const ContentSettingsTypeIdEntry kBlockedTitleIDs[] = { | 122 static const ContentSettingsTypeIdEntry kBlockedTitleIDs[] = { |
| 112 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_TITLE}, | 123 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_TITLE}, |
| 113 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_TITLE}, | 124 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_TITLE}, |
| 114 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_TITLE}, | 125 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_TITLE}, |
| 115 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_MESSAGE}, | 126 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_TITLE}, |
| 116 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_TITLE}, | 127 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_TITLE}, |
| 117 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, | 128 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, |
| 118 IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT}, | 129 IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT}, |
| 119 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, | 130 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, |
| 120 IDS_BLOCKED_PPAPI_BROKER_TITLE}, | 131 IDS_BLOCKED_PPAPI_BROKER_TITLE}, |
| 121 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_TITLE}, | 132 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_TITLE}, |
| 122 }; | 133 }; |
| 123 // Fields as for kBlockedTitleIDs, above. | 134 // Fields as for kBlockedTitleIDs, above. |
| 124 static const ContentSettingsTypeIdEntry kAccessedTitleIDs[] = { | 135 static const ContentSettingsTypeIdEntry kAccessedTitleIDs[] = { |
| 125 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_ACCESSED_COOKIES_TITLE}, | 136 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_ACCESSED_COOKIES_TITLE}, |
| (...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1294 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1305 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 1295 DCHECK_EQ(web_contents_, | 1306 DCHECK_EQ(web_contents_, |
| 1296 content::Source<WebContents>(source).ptr()); | 1307 content::Source<WebContents>(source).ptr()); |
| 1297 web_contents_ = NULL; | 1308 web_contents_ = NULL; |
| 1298 } else { | 1309 } else { |
| 1299 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1310 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
| 1300 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1311 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
| 1301 profile_ = NULL; | 1312 profile_ = NULL; |
| 1302 } | 1313 } |
| 1303 } | 1314 } |
| OLD | NEW |