OLD | NEW |
1 // Copyright (c) 2012 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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 { "mouselock_header", IDS_MOUSE_LOCK_HEADER }, | 276 { "mouselock_header", IDS_MOUSE_LOCK_HEADER }, |
277 { "mouselock_allow", IDS_MOUSE_LOCK_ALLOW_RADIO }, | 277 { "mouselock_allow", IDS_MOUSE_LOCK_ALLOW_RADIO }, |
278 { "mouselock_ask", IDS_MOUSE_LOCK_ASK_RADIO }, | 278 { "mouselock_ask", IDS_MOUSE_LOCK_ASK_RADIO }, |
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_web_intents", | 285 localized_strings->SetBoolean("enable_web_intents", |
286 !CommandLine::ForCurrentProcess()->HasSwitch( | 286 CommandLine::ForCurrentProcess()->HasSwitch( |
287 switches::kDisableWebIntents)); | 287 switches::kEnableWebIntents)); |
288 } | 288 } |
289 | 289 |
290 void ContentSettingsHandler::Initialize() { | 290 void ContentSettingsHandler::Initialize() { |
291 notification_registrar_.Add( | 291 notification_registrar_.Add( |
292 this, chrome::NOTIFICATION_PROFILE_CREATED, | 292 this, chrome::NOTIFICATION_PROFILE_CREATED, |
293 content::NotificationService::AllSources()); | 293 content::NotificationService::AllSources()); |
294 notification_registrar_.Add( | 294 notification_registrar_.Add( |
295 this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 295 this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
296 content::NotificationService::AllSources()); | 296 content::NotificationService::AllSources()); |
297 | 297 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 430 |
431 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 431 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
432 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 432 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
433 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 433 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
434 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); | 434 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); |
435 } | 435 } |
436 } | 436 } |
437 | 437 |
438 void ContentSettingsHandler::UpdateExceptionsViewFromModel( | 438 void ContentSettingsHandler::UpdateExceptionsViewFromModel( |
439 ContentSettingsType type) { | 439 ContentSettingsType type) { |
440 // Don't update intents settings at this point. | 440 // Skip updating intents unless it's enabled from the command line. |
441 // Turn on when enable_web_intents_tag is enabled. | 441 if (type == CONTENT_SETTINGS_TYPE_INTENTS && |
442 if (type == CONTENT_SETTINGS_TYPE_INTENTS) | 442 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 443 switches::kEnableWebIntents)) |
443 return; | 444 return; |
444 | 445 |
445 switch (type) { | 446 switch (type) { |
446 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 447 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
447 UpdateGeolocationExceptionsView(); | 448 UpdateGeolocationExceptionsView(); |
448 break; | 449 break; |
449 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 450 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
450 UpdateNotificationExceptionsView(); | 451 UpdateNotificationExceptionsView(); |
451 break; | 452 break; |
452 default: | 453 default: |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 871 |
871 HostContentSettingsMap* | 872 HostContentSettingsMap* |
872 ContentSettingsHandler::GetOTRContentSettingsMap() { | 873 ContentSettingsHandler::GetOTRContentSettingsMap() { |
873 Profile* profile = Profile::FromWebUI(web_ui()); | 874 Profile* profile = Profile::FromWebUI(web_ui()); |
874 if (profile->HasOffTheRecordProfile()) | 875 if (profile->HasOffTheRecordProfile()) |
875 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 876 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
876 return NULL; | 877 return NULL; |
877 } | 878 } |
878 | 879 |
879 } // namespace options2 | 880 } // namespace options2 |
OLD | NEW |