| 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 <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 GetProtocolHandlerRegistry()->enabled()); | 382 GetProtocolHandlerRegistry()->enabled()); |
| 383 | 383 |
| 384 web_ui_->CallJavascriptFunction("ContentSettings.updateHandlersEnabledRadios", | 384 web_ui_->CallJavascriptFunction("ContentSettings.updateHandlersEnabledRadios", |
| 385 handlers_enabled); | 385 handlers_enabled); |
| 386 #endif // defined(ENABLE_REGISTER_PROTOCOL_HANDLER) | 386 #endif // defined(ENABLE_REGISTER_PROTOCOL_HANDLER) |
| 387 } | 387 } |
| 388 | 388 |
| 389 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { | 389 void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { |
| 390 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 390 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 391 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 391 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 392 // The content settings type CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE |
| 393 // is supposed to be set by policy only. Hence there is no user facing UI |
| 394 // for this content type and we skip it here. |
| 395 if (type == CONTENT_SETTINGS_TYPE_AUTO_SUBMIT_CERTIFICATE) |
| 396 continue; |
| 392 UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); | 397 UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); |
| 393 } | 398 } |
| 394 } | 399 } |
| 395 | 400 |
| 396 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { | 401 void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { |
| 397 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; | 402 for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; |
| 398 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 403 type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
| 399 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); | 404 UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); |
| 400 } | 405 } |
| 401 } | 406 } |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); | 748 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); |
| 744 } | 749 } |
| 745 | 750 |
| 746 HostContentSettingsMap* | 751 HostContentSettingsMap* |
| 747 ContentSettingsHandler::GetOTRContentSettingsMap() { | 752 ContentSettingsHandler::GetOTRContentSettingsMap() { |
| 748 Profile* profile = Profile::FromWebUI(web_ui_); | 753 Profile* profile = Profile::FromWebUI(web_ui_); |
| 749 if (profile->HasOffTheRecordProfile()) | 754 if (profile->HasOffTheRecordProfile()) |
| 750 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 755 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
| 751 return NULL; | 756 return NULL; |
| 752 } | 757 } |
| OLD | NEW |