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

Unified Diff: chrome/browser/ui/zoom/zoom_controller.cc

Issue 23851016: Convert zoom callbacks to use CallbackRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/zoom/zoom_controller.cc
diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc
index c5e9a1d54806d66b97c5986ddf07eda9b95b11dd..9c97feaa88f28ca3697d46b00d66e9519864a3ef 100644
--- a/chrome/browser/ui/zoom/zoom_controller.cc
+++ b/chrome/browser/ui/zoom/zoom_controller.cc
@@ -25,9 +25,7 @@ ZoomController::ZoomController(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
zoom_percent_(100),
observer_(NULL),
- browser_context_(web_contents->GetBrowserContext()),
- zoom_callback_(base::Bind(&ZoomController::OnZoomLevelChanged,
- base::Unretained(this))) {
+ browser_context_(web_contents->GetBrowserContext()) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
default_zoom_level_.Init(prefs::kDefaultZoomLevel, profile->GetPrefs(),
@@ -35,18 +33,15 @@ ZoomController::ZoomController(content::WebContents* web_contents)
base::Unretained(this),
std::string()));
- content::HostZoomMap::GetForBrowserContext(
+ zoom_subscription_ = content::HostZoomMap::GetForBrowserContext(
browser_context_)->AddZoomLevelChangedCallback(
- zoom_callback_);
+ base::Bind(&ZoomController::OnZoomLevelChanged,
+ base::Unretained(this)));
UpdateState(std::string());
}
-ZoomController::~ZoomController() {
- content::HostZoomMap::GetForBrowserContext(
- browser_context_)->RemoveZoomLevelChangedCallback(
- zoom_callback_);
-}
+ZoomController::~ZoomController() {}
bool ZoomController::IsAtDefaultZoom() const {
return content::ZoomValuesEqual(web_contents()->GetZoomLevel(),
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.h ('k') | content/browser/host_zoom_map_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698