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/options/content_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 return DesktopNotificationServiceFactory::GetForProfile( | 376 return DesktopNotificationServiceFactory::GetForProfile( |
377 web_ui_->GetProfile())->IsDefaultContentSettingManaged(); | 377 web_ui_->GetProfile())->IsDefaultContentSettingManaged(); |
378 } else { | 378 } else { |
379 return GetContentSettingsMap()->IsDefaultContentSettingManaged(type); | 379 return GetContentSettingsMap()->IsDefaultContentSettingManaged(type); |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 void ContentSettingsHandler::UpdateHandlersEnabledRadios() { | 383 void ContentSettingsHandler::UpdateHandlersEnabledRadios() { |
384 #if defined(ENABLE_REGISTER_PROTOCOL_HANDLER) | 384 #if defined(ENABLE_REGISTER_PROTOCOL_HANDLER) |
385 DCHECK(web_ui_); | 385 DCHECK(web_ui_); |
386 FundamentalValue handlers_enabled(GetProtocolHandlerRegistry()->enabled()); | 386 base::FundamentalValue handlers_enabled( |
| 387 GetProtocolHandlerRegistry()->enabled()); |
387 | 388 |
388 web_ui_->CallJavascriptFunction("ContentSettings.updateHandlersEnabledRadios", | 389 web_ui_->CallJavascriptFunction("ContentSettings.updateHandlersEnabledRadios", |
389 handlers_enabled); | 390 handlers_enabled); |
390 #endif // defined(ENABLE_REGISTER_PROTOCOL_HANDLER) | 391 #endif // defined(ENABLE_REGISTER_PROTOCOL_HANDLER) |
391 } | 392 } |
392 | 393 |
393 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { | 394 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { |
394 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 395 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
395 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 396 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
396 UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); | 397 UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 return web_ui_->GetProfile()->GetProtocolHandlerRegistry(); | 718 return web_ui_->GetProfile()->GetProtocolHandlerRegistry(); |
718 } | 719 } |
719 | 720 |
720 HostContentSettingsMap* | 721 HostContentSettingsMap* |
721 ContentSettingsHandler::GetOTRContentSettingsMap() { | 722 ContentSettingsHandler::GetOTRContentSettingsMap() { |
722 Profile* profile = web_ui_->GetProfile(); | 723 Profile* profile = web_ui_->GetProfile(); |
723 if (profile->HasOffTheRecordProfile()) | 724 if (profile->HasOffTheRecordProfile()) |
724 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 725 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
725 return NULL; | 726 return NULL; |
726 } | 727 } |
OLD | NEW |