OLD | NEW |
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/webui/options2/content_settings_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/content_settings_handler2.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 { "mouselock_block", IDS_MOUSE_LOCK_BLOCK_RADIO }, | 279 { "mouselock_block", IDS_MOUSE_LOCK_BLOCK_RADIO }, |
280 }; | 280 }; |
281 | 281 |
282 RegisterStrings(localized_strings, resources, arraysize(resources)); | 282 RegisterStrings(localized_strings, resources, arraysize(resources)); |
283 RegisterTitle(localized_strings, "contentSettingsPage", | 283 RegisterTitle(localized_strings, "contentSettingsPage", |
284 IDS_CONTENT_SETTINGS_TITLE); | 284 IDS_CONTENT_SETTINGS_TITLE); |
285 localized_strings->SetBoolean("enable_click_to_play", | 285 localized_strings->SetBoolean("enable_click_to_play", |
286 CommandLine::ForCurrentProcess()->HasSwitch( | 286 CommandLine::ForCurrentProcess()->HasSwitch( |
287 switches::kEnableClickToPlay)); | 287 switches::kEnableClickToPlay)); |
288 localized_strings->SetBoolean("enable_web_intents", | 288 localized_strings->SetBoolean("enable_web_intents", |
289 !CommandLine::ForCurrentProcess()->HasSwitch( | 289 CommandLine::ForCurrentProcess()->HasSwitch( |
290 switches::kDisableWebIntents)); | 290 switches::kEnableWebIntents)); |
291 } | 291 } |
292 | 292 |
293 void ContentSettingsHandler::Initialize() { | 293 void ContentSettingsHandler::Initialize() { |
294 notification_registrar_.Add( | 294 notification_registrar_.Add( |
295 this, chrome::NOTIFICATION_PROFILE_CREATED, | 295 this, chrome::NOTIFICATION_PROFILE_CREATED, |
296 content::NotificationService::AllSources()); | 296 content::NotificationService::AllSources()); |
297 notification_registrar_.Add( | 297 notification_registrar_.Add( |
298 this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 298 this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
299 content::NotificationService::AllSources()); | 299 content::NotificationService::AllSources()); |
300 | 300 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 434 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
435 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 435 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
436 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 436 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
437 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); | 437 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 void ContentSettingsHandler::UpdateExceptionsViewFromModel( | 441 void ContentSettingsHandler::UpdateExceptionsViewFromModel( |
442 ContentSettingsType type) { | 442 ContentSettingsType type) { |
443 // Update intents unless it's disabled from the command line. | 443 // Skip updating intents unless it's enabled from the command line. |
444 if (type == CONTENT_SETTINGS_TYPE_INTENTS && | 444 if (type == CONTENT_SETTINGS_TYPE_INTENTS && |
445 CommandLine::ForCurrentProcess()->HasSwitch( | 445 !CommandLine::ForCurrentProcess()->HasSwitch( |
446 switches::kDisableWebIntents)) | 446 switches::kEnableWebIntents)) |
447 return; | 447 return; |
448 | 448 |
449 switch (type) { | 449 switch (type) { |
450 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 450 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
451 UpdateGeolocationExceptionsView(); | 451 UpdateGeolocationExceptionsView(); |
452 break; | 452 break; |
453 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 453 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
454 UpdateNotificationExceptionsView(); | 454 UpdateNotificationExceptionsView(); |
455 break; | 455 break; |
456 default: | 456 default: |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 | 874 |
875 HostContentSettingsMap* | 875 HostContentSettingsMap* |
876 ContentSettingsHandler::GetOTRContentSettingsMap() { | 876 ContentSettingsHandler::GetOTRContentSettingsMap() { |
877 Profile* profile = Profile::FromWebUI(web_ui()); | 877 Profile* profile = Profile::FromWebUI(web_ui()); |
878 if (profile->HasOffTheRecordProfile()) | 878 if (profile->HasOffTheRecordProfile()) |
879 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 879 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
880 return NULL; | 880 return NULL; |
881 } | 881 } |
882 | 882 |
883 } // namespace options2 | 883 } // namespace options2 |
OLD | NEW |