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

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: Address 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 // and we're only interested in non-temporary, host-only zoom levels.
awong 2014/08/12 21:07:06 Needs more "why" in the comment. :)
wjmaclean 2014/08/13 17:16:03 Done.
520 host_zoom_map_subscription_ = 520 host_zoom_map_subscription_ =
521 host_zoom_map->AddZoomLevelChangedCallback( 521 content::HostZoomMap::GetForBrowserContext(context)
522 base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, 522 ->AddZoomLevelChangedCallback(
523 base::Unretained(this))); 523 base::Bind(&ContentSettingsHandler::OnZoomLevelChanged,
524 base::Unretained(this)));
524 525
525 flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context)); 526 flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context));
526 } 527 }
527 528
528 void ContentSettingsHandler::InitializePage() { 529 void ContentSettingsHandler::InitializePage() {
529 media_settings_ = MediaSettingsInfo(); 530 media_settings_ = MediaSettingsInfo();
530 RefreshFlashMediaSettings(); 531 RefreshFlashMediaSettings();
531 532
532 UpdateHandlersEnabledRadios(); 533 UpdateHandlersEnabledRadios();
533 UpdateAllExceptionsViewsFromModel(); 534 UpdateAllExceptionsViewsFromModel();
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { 1575 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() {
1575 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); 1576 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui()));
1576 // Exceptions apply only when the feature is enabled. 1577 // Exceptions apply only when the feature is enabled.
1577 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1578 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1578 web_ui()->CallJavascriptFunction( 1579 web_ui()->CallJavascriptFunction(
1579 "ContentSettings.enableProtectedContentExceptions", 1580 "ContentSettings.enableProtectedContentExceptions",
1580 base::FundamentalValue(enable_exceptions)); 1581 base::FundamentalValue(enable_exceptions));
1581 } 1582 }
1582 1583
1583 } // namespace options 1584 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698