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 <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 pref_change_registrar_.Add( | 483 pref_change_registrar_.Add( |
484 prefs::kVideoCaptureAllowed, | 484 prefs::kVideoCaptureAllowed, |
485 base::Bind(&ContentSettingsHandler::UpdateMediaSettingsView, | 485 base::Bind(&ContentSettingsHandler::UpdateMediaSettingsView, |
486 base::Unretained(this))); | 486 base::Unretained(this))); |
487 pref_change_registrar_.Add( | 487 pref_change_registrar_.Add( |
488 prefs::kEnableDRM, | 488 prefs::kEnableDRM, |
489 base::Bind( | 489 base::Bind( |
490 &ContentSettingsHandler::UpdateProtectedContentExceptionsButton, | 490 &ContentSettingsHandler::UpdateProtectedContentExceptionsButton, |
491 base::Unretained(this))); | 491 base::Unretained(this))); |
492 | 492 |
493 content::HostZoomMap* host_zoom_map = | 493 // Here we only subscribe to the HostZoomMap for the default storage partition |
494 content::HostZoomMap::GetDefaultForBrowserContext(context); | 494 // since we don't allow the user to manage the zoom levels for apps. |
| 495 // We're only interested in zoom-levels that are persisted, since the user |
| 496 // is given the opportunity to view/delete these in the content-settings page. |
495 host_zoom_map_subscription_ = | 497 host_zoom_map_subscription_ = |
496 host_zoom_map->AddZoomLevelChangedCallback( | 498 content::HostZoomMap::GetDefaultForBrowserContext(context) |
497 base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, | 499 ->AddZoomLevelChangedCallback( |
498 base::Unretained(this))); | 500 base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, |
| 501 base::Unretained(this))); |
499 | 502 |
500 flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context)); | 503 flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context)); |
501 | 504 |
502 Profile* profile = Profile::FromWebUI(web_ui()); | 505 Profile* profile = Profile::FromWebUI(web_ui()); |
503 observer_.Add(profile->GetHostContentSettingsMap()); | 506 observer_.Add(profile->GetHostContentSettingsMap()); |
504 if (profile->HasOffTheRecordProfile()) { | 507 if (profile->HasOffTheRecordProfile()) { |
505 auto map = profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); | 508 auto map = profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
506 if (!observer_.IsObserving(map)) | 509 if (!observer_.IsObserving(map)) |
507 observer_.Add(map); | 510 observer_.Add(map); |
508 } | 511 } |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 | 1528 |
1526 // Exceptions apply only when the feature is enabled. | 1529 // Exceptions apply only when the feature is enabled. |
1527 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1530 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1528 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1531 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1529 web_ui()->CallJavascriptFunction( | 1532 web_ui()->CallJavascriptFunction( |
1530 "ContentSettings.enableProtectedContentExceptions", | 1533 "ContentSettings.enableProtectedContentExceptions", |
1531 base::FundamentalValue(enable_exceptions)); | 1534 base::FundamentalValue(enable_exceptions)); |
1532 } | 1535 } |
1533 | 1536 |
1534 } // namespace options | 1537 } // namespace options |
OLD | NEW |