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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_UNBLOCK}, | 297 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_UNBLOCK}, |
| 298 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_UNBLOCK}, | 298 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_UNBLOCK}, |
| 299 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_UNBLOCK}, | 299 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_UNBLOCK}, |
| 300 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_UNBLOCK_ALL}, | 300 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_UNBLOCK_ALL}, |
| 301 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_UNBLOCK}, | 301 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_UNBLOCK}, |
| 302 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_UNBLOCK}, | 302 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_UNBLOCK}, |
| 303 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_UNBLOCK}, | 303 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_UNBLOCK}, |
| 304 }; | 304 }; |
| 305 // Fields as for kBlockedAllowIDs, above. | 305 // Fields as for kBlockedAllowIDs, above. |
| 306 static const ContentSettingsTypeIdEntry kAllowedAllowIDs[] = { | 306 static const ContentSettingsTypeIdEntry kAllowedAllowIDs[] = { |
| 307 // TODO(bauerb): The string shouldn't be "unblock" (they weren't blocked). | 307 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_ALLOW}, |
|
Bernhard Bauer
2015/06/04 08:08:02
This doesn't really change anything if the string
Deepak
2015/06/04 10:09:10
Done.
| |
| 308 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_UNBLOCK}, | |
| 309 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_ALLOWED_PPAPI_BROKER_NO_ACTION}, | 308 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_ALLOWED_PPAPI_BROKER_NO_ACTION}, |
| 310 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_ALLOWED_DOWNLOAD_NO_ACTION}, | 309 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_ALLOWED_DOWNLOAD_NO_ACTION}, |
| 311 }; | 310 }; |
| 312 | 311 |
| 313 std::string radio_allow_label; | 312 std::string radio_allow_label; |
| 314 if (allowed) { | 313 if (allowed) { |
| 315 int resource_id = GetIdForContentType(kAllowedAllowIDs, | 314 int resource_id = GetIdForContentType(kAllowedAllowIDs, |
| 316 arraysize(kAllowedAllowIDs), | 315 arraysize(kAllowedAllowIDs), |
| 317 content_type()); | 316 content_type()); |
| 318 radio_allow_label = (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) ? | 317 radio_allow_label = (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) ? |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 329 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_NO_ACTION}, | 328 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_NO_ACTION}, |
| 330 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_NO_ACTION}, | 329 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_NO_ACTION}, |
| 331 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_NO_ACTION}, | 330 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_NO_ACTION}, |
| 332 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_NO_ACTION}, | 331 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_NO_ACTION}, |
| 333 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_NO_ACTION}, | 332 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_NO_ACTION}, |
| 334 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_NO_ACTION}, | 333 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_BLOCKED_PPAPI_BROKER_NO_ACTION}, |
| 335 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_NO_ACTION}, | 334 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOAD_NO_ACTION}, |
| 336 }; | 335 }; |
| 337 static const ContentSettingsTypeIdEntry kAllowedBlockIDs[] = { | 336 static const ContentSettingsTypeIdEntry kAllowedBlockIDs[] = { |
| 338 // TODO(bauerb): The string should say "block". | 337 // TODO(bauerb): The string should say "block". |
| 339 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_NO_ACTION}, | 338 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_NO_ACTION}, |
|
Bernhard Bauer
2015/06/04 08:08:02
Similarly, here the string ID should be IDS_ALLOWE
Deepak
2015/06/04 10:09:10
Done.
| |
| 340 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_ALLOWED_PPAPI_BROKER_BLOCK}, | 339 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_ALLOWED_PPAPI_BROKER_BLOCK}, |
| 341 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_ALLOWED_DOWNLOAD_BLOCK}, | 340 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_ALLOWED_DOWNLOAD_BLOCK}, |
| 342 }; | 341 }; |
| 343 | 342 |
| 344 std::string radio_block_label; | 343 std::string radio_block_label; |
| 345 if (allowed) { | 344 if (allowed) { |
| 346 int resource_id = GetIdForContentType(kAllowedBlockIDs, | 345 int resource_id = GetIdForContentType(kAllowedBlockIDs, |
| 347 arraysize(kAllowedBlockIDs), | 346 arraysize(kAllowedBlockIDs), |
| 348 content_type()); | 347 content_type()); |
| 349 radio_block_label = (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) ? | 348 radio_block_label = (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) ? |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1305 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1304 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 1306 DCHECK_EQ(web_contents_, | 1305 DCHECK_EQ(web_contents_, |
| 1307 content::Source<WebContents>(source).ptr()); | 1306 content::Source<WebContents>(source).ptr()); |
| 1308 web_contents_ = NULL; | 1307 web_contents_ = NULL; |
| 1309 } else { | 1308 } else { |
| 1310 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1309 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
| 1311 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1310 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
| 1312 profile_ = NULL; | 1311 profile_ = NULL; |
| 1313 } | 1312 } |
| 1314 } | 1313 } |
| OLD | NEW |