Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove ref counts, improve comments. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 pref_change_registrar_.Add( 508 pref_change_registrar_.Add(
509 prefs::kVideoCaptureAllowed, 509 prefs::kVideoCaptureAllowed,
510 base::Bind(&ContentSettingsHandler::UpdateMediaSettingsView, 510 base::Bind(&ContentSettingsHandler::UpdateMediaSettingsView,
511 base::Unretained(this))); 511 base::Unretained(this)));
512 pref_change_registrar_.Add( 512 pref_change_registrar_.Add(
513 prefs::kEnableDRM, 513 prefs::kEnableDRM,
514 base::Bind( 514 base::Bind(
515 &ContentSettingsHandler::UpdateProtectedContentExceptionsButton, 515 &ContentSettingsHandler::UpdateProtectedContentExceptionsButton,
516 base::Unretained(this))); 516 base::Unretained(this)));
517 517
518 content::HostZoomMap* host_zoom_map = 518 // Here we only subscribe to the HostZoomMap for the default storage partition
519 content::HostZoomMap::GetForBrowserContext(context); 519 // since we don't allow the user to manage the zoom levels for apps.
520 // We're only interested in zoom-levels that are persisted, since the user
521 // is given the opportunity to view/delete these in the content-settings page.
520 host_zoom_map_subscription_ = 522 host_zoom_map_subscription_ =
521 host_zoom_map->AddZoomLevelChangedCallback( 523 content::HostZoomMap::GetForBrowserContext(context)
522 base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, 524 ->AddZoomLevelChangedCallback(
523 base::Unretained(this))); 525 base::Bind(&ContentSettingsHandler::OnZoomLevelChanged,
526 base::Unretained(this)));
524 527
525 flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context)); 528 flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context));
526 } 529 }
527 530
528 void ContentSettingsHandler::InitializePage() { 531 void ContentSettingsHandler::InitializePage() {
529 media_settings_ = MediaSettingsInfo(); 532 media_settings_ = MediaSettingsInfo();
530 RefreshFlashMediaSettings(); 533 RefreshFlashMediaSettings();
531 534
532 UpdateHandlersEnabledRadios(); 535 UpdateHandlersEnabledRadios();
533 UpdateAllExceptionsViewsFromModel(); 536 UpdateAllExceptionsViewsFromModel();
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { 1577 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() {
1575 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); 1578 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui()));
1576 // Exceptions apply only when the feature is enabled. 1579 // Exceptions apply only when the feature is enabled.
1577 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1580 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1578 web_ui()->CallJavascriptFunction( 1581 web_ui()->CallJavascriptFunction(
1579 "ContentSettings.enableProtectedContentExceptions", 1582 "ContentSettings.enableProtectedContentExceptions",
1580 base::FundamentalValue(enable_exceptions)); 1583 base::FundamentalValue(enable_exceptions));
1581 } 1584 }
1582 1585
1583 } // namespace options 1586 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698