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/webui/options/content_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/content_settings/content_settings_details.h" | 15 #include "chrome/browser/content_settings/content_settings_details.h" |
16 #include "chrome/browser/content_settings/content_settings_utils.h" | 16 #include "chrome/browser/content_settings/content_settings_utils.h" |
17 #include "chrome/browser/content_settings/host_content_settings_map.h" | 17 #include "chrome/browser/content_settings/host_content_settings_map.h" |
18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
19 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
20 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 20 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
21 #include "chrome/browser/intents/web_intents_util.h" | |
22 #include "chrome/browser/notifications/desktop_notification_service.h" | 21 #include "chrome/browser/notifications/desktop_notification_service.h" |
23 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 22 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
24 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
25 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/browser/ui/browser_list.h" | 25 #include "chrome/browser/ui/browser_list.h" |
27 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
28 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/content_settings.h" | 28 #include "chrome/common/content_settings.h" |
30 #include "chrome/common/content_settings_pattern.h" | 29 #include "chrome/common/content_settings_pattern.h" |
31 #include "chrome/common/extensions/permissions/api_permission.h" | 30 #include "chrome/common/extensions/permissions/api_permission.h" |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 { "location_allow", IDS_GEOLOCATION_ALLOW_RADIO }, | 379 { "location_allow", IDS_GEOLOCATION_ALLOW_RADIO }, |
381 { "location_ask", IDS_GEOLOCATION_ASK_RADIO }, | 380 { "location_ask", IDS_GEOLOCATION_ASK_RADIO }, |
382 { "location_block", IDS_GEOLOCATION_BLOCK_RADIO }, | 381 { "location_block", IDS_GEOLOCATION_BLOCK_RADIO }, |
383 { "set_by", IDS_GEOLOCATION_SET_BY_HOVER }, | 382 { "set_by", IDS_GEOLOCATION_SET_BY_HOVER }, |
384 // Notifications filter. | 383 // Notifications filter. |
385 { "notifications_tab_label", IDS_NOTIFICATIONS_TAB_LABEL }, | 384 { "notifications_tab_label", IDS_NOTIFICATIONS_TAB_LABEL }, |
386 { "notifications_header", IDS_NOTIFICATIONS_HEADER }, | 385 { "notifications_header", IDS_NOTIFICATIONS_HEADER }, |
387 { "notifications_allow", IDS_NOTIFICATIONS_ALLOW_RADIO }, | 386 { "notifications_allow", IDS_NOTIFICATIONS_ALLOW_RADIO }, |
388 { "notifications_ask", IDS_NOTIFICATIONS_ASK_RADIO }, | 387 { "notifications_ask", IDS_NOTIFICATIONS_ASK_RADIO }, |
389 { "notifications_block", IDS_NOTIFICATIONS_BLOCK_RADIO }, | 388 { "notifications_block", IDS_NOTIFICATIONS_BLOCK_RADIO }, |
390 // Intents filter. | |
391 { "webIntentsTabLabel", IDS_WEB_INTENTS_TAB_LABEL }, | |
392 { "allowWebIntents", IDS_ALLOW_WEB_INTENTS }, | |
393 // Fullscreen filter. | 389 // Fullscreen filter. |
394 { "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL }, | 390 { "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL }, |
395 { "fullscreen_header", IDS_FULLSCREEN_HEADER }, | 391 { "fullscreen_header", IDS_FULLSCREEN_HEADER }, |
396 // Mouse Lock filter. | 392 // Mouse Lock filter. |
397 { "mouselock_tab_label", IDS_MOUSE_LOCK_TAB_LABEL }, | 393 { "mouselock_tab_label", IDS_MOUSE_LOCK_TAB_LABEL }, |
398 { "mouselock_header", IDS_MOUSE_LOCK_HEADER }, | 394 { "mouselock_header", IDS_MOUSE_LOCK_HEADER }, |
399 { "mouselock_allow", IDS_MOUSE_LOCK_ALLOW_RADIO }, | 395 { "mouselock_allow", IDS_MOUSE_LOCK_ALLOW_RADIO }, |
400 { "mouselock_ask", IDS_MOUSE_LOCK_ASK_RADIO }, | 396 { "mouselock_ask", IDS_MOUSE_LOCK_ASK_RADIO }, |
401 { "mouselock_block", IDS_MOUSE_LOCK_BLOCK_RADIO }, | 397 { "mouselock_block", IDS_MOUSE_LOCK_BLOCK_RADIO }, |
402 // Pepper Flash camera and microphone filter. | 398 // Pepper Flash camera and microphone filter. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 IDS_FULLSCREEN_TAB_LABEL); | 445 IDS_FULLSCREEN_TAB_LABEL); |
450 RegisterTitle(localized_strings, "mouselock", | 446 RegisterTitle(localized_strings, "mouselock", |
451 IDS_MOUSE_LOCK_TAB_LABEL); | 447 IDS_MOUSE_LOCK_TAB_LABEL); |
452 RegisterTitle(localized_strings, "pepper-flash-cameramic", | 448 RegisterTitle(localized_strings, "pepper-flash-cameramic", |
453 IDS_PEPPER_FLASH_CAMERAMIC_TAB_LABEL); | 449 IDS_PEPPER_FLASH_CAMERAMIC_TAB_LABEL); |
454 RegisterTitle(localized_strings, "media-stream", | 450 RegisterTitle(localized_strings, "media-stream", |
455 IDS_MEDIA_STREAM_TAB_LABEL); | 451 IDS_MEDIA_STREAM_TAB_LABEL); |
456 RegisterTitle(localized_strings, "ppapi-broker", | 452 RegisterTitle(localized_strings, "ppapi-broker", |
457 IDS_PPAPI_BROKER_TAB_LABEL); | 453 IDS_PPAPI_BROKER_TAB_LABEL); |
458 | 454 |
459 Profile* profile = Profile::FromWebUI(web_ui()); | |
460 localized_strings->SetBoolean( | |
461 "enable_web_intents", | |
462 web_intents::IsWebIntentsEnabledForProfile(profile)); | |
463 | |
464 localized_strings->SetBoolean("newContentSettings", | 455 localized_strings->SetBoolean("newContentSettings", |
465 CommandLine::ForCurrentProcess()->HasSwitch(switches::kContentSettings2)); | 456 CommandLine::ForCurrentProcess()->HasSwitch(switches::kContentSettings2)); |
466 } | 457 } |
467 | 458 |
468 void ContentSettingsHandler::InitializeHandler() { | 459 void ContentSettingsHandler::InitializeHandler() { |
469 notification_registrar_.Add( | 460 notification_registrar_.Add( |
470 this, chrome::NOTIFICATION_PROFILE_CREATED, | 461 this, chrome::NOTIFICATION_PROFILE_CREATED, |
471 content::NotificationService::AllSources()); | 462 content::NotificationService::AllSources()); |
472 notification_registrar_.Add( | 463 notification_registrar_.Add( |
473 this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 464 this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { | 1306 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
1316 if (type == kExContentSettingsTypeGroupNames[i].type) | 1307 if (type == kExContentSettingsTypeGroupNames[i].type) |
1317 return kExContentSettingsTypeGroupNames[i].name; | 1308 return kExContentSettingsTypeGroupNames[i].name; |
1318 } | 1309 } |
1319 | 1310 |
1320 NOTREACHED(); | 1311 NOTREACHED(); |
1321 return std::string(); | 1312 return std::string(); |
1322 } | 1313 } |
1323 | 1314 |
1324 } // namespace options | 1315 } // namespace options |
OLD | NEW |