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

Unified Diff: chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm

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
Index: chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm b/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
index b4aeda60ba073ed5679ac6cb22599e7ab800beac..86231dc6f263efc2fd9763bfe3546569bb704a79 100644
--- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
+++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm
@@ -21,19 +21,18 @@ class ZoomDecorationTest : public InProcessBrowserTest {
protected:
ZoomDecorationTest()
: InProcessBrowserTest(),
- should_quit_on_zoom_(false),
- zoom_callback_(base::Bind(&ZoomDecorationTest::OnZoomChanged,
- base::Unretained(this))) {
+ should_quit_on_zoom_(false) {
}
virtual void SetUpOnMainThread() OVERRIDE {
- content::HostZoomMap::GetForBrowserContext(
- browser()->profile())->AddZoomLevelChangedCallback(zoom_callback_);
+ zoom_subscription_ = content::HostZoomMap::GetForBrowserContext(
+ browser()->profile())->AddZoomLevelChangedCallback(
+ base::Bind(&ZoomDecorationTest::OnZoomChanged,
+ base::Unretained(this)));
}
virtual void CleanUpOnMainThread() OVERRIDE {
- content::HostZoomMap::GetForBrowserContext(
- browser()->profile())->RemoveZoomLevelChangedCallback(zoom_callback_);
+ zoom_subscription_.reset();
}
LocationBarViewMac* GetLocationBar() const {
@@ -73,7 +72,7 @@ class ZoomDecorationTest : public InProcessBrowserTest {
private:
bool should_quit_on_zoom_;
- content::HostZoomMap::ZoomLevelChangedCallback zoom_callback_;
+ scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_;
DISALLOW_COPY_AND_ASSIGN(ZoomDecorationTest);
};
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698