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

Unified Diff: chrome/browser/ui/cocoa/location_bar/zoom_decoration.h

Issue 10736028: Refactor browser window zoom handling and enable zoom icon on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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.h
diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h
new file mode 100644
index 0000000000000000000000000000000000000000..c81f4957f885a16190fea1df7eb7f192094a2dff
--- /dev/null
+++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_
+#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/basictypes.h"
+#include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
+#include "chrome/browser/ui/zoom/zoom_controller.h"
+
+class ToolbarModel;
+
+// Zoom icon at the end of the omnibox (close to page actions) when at a
+// non-standard zoom level.
+class ZoomDecoration : public ImageDecoration {
+ public:
+ explicit ZoomDecoration(ToolbarModel* toolbar_model);
+ virtual ~ZoomDecoration();
+
+ // Called when this decoration should show or hide itself in its most current
+ // state.
+ void Update(ZoomController* zoom_controller);
+
+ private:
+ // LocationBarDecoration implementation.
+ virtual NSString* GetToolTip() OVERRIDE;
+
+ // A reference to the toolbar model to query whether input is currently
+ // happening in the location bar. Not owned by this class.
+ ToolbarModel* toolbar_model_;
+
+ // The string to show for a tooltip.
+ scoped_nsobject<NSString> tooltip_;
+
+ DISALLOW_COPY_AND_ASSIGN(ZoomDecoration);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_

Powered by Google App Engine
This is Rietveld 408576698