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

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

Issue 151283006: Mac OS X: Show the Translate icon on Omnibox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue-307352-translate-bubble-2
Patch Set: . Created 6 years, 10 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/translate_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/translate_decoration.h b/chrome/browser/ui/cocoa/location_bar/translate_decoration.h
new file mode 100644
index 0000000000000000000000000000000000000000..f87dc2e4103bd2fe6890820906de146185ad99f7
--- /dev/null
+++ b/chrome/browser/ui/cocoa/location_bar/translate_decoration.h
@@ -0,0 +1,41 @@
+// Copyright 2013 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_TRANSLATE_DECORATION_H_
+#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
+
+class CommandUpdater;
+
+class TranslateDecoration : public ImageDecoration {
+ public:
+ explicit TranslateDecoration(CommandUpdater* command_updater);
+ virtual ~TranslateDecoration();
+
+ // Toggles the icon on or off.
+ void SetToggled(bool on);
Nico 2014/02/05 06:07:18 SetOn or something. "Toggled" isn't something wher
hajimehoshi 2014/02/05 11:08:03 Done.
+
+ // Get the point where the translate bubble should point within the
+ // decoration's frame.
+ NSPoint GetBubblePointInFrame(NSRect frame);
+
+ private:
+ // Implement |LocationBarDecoration|
+ virtual bool AcceptsMousePress() OVERRIDE;
+ virtual bool OnMousePressed(NSRect frame) OVERRIDE;
+ virtual NSString* GetToolTip() OVERRIDE;
+
+ // For showing the translate bubble up.
+ CommandUpdater* command_updater_; // Weak, owned by Browser.
+
+ // Whether the translate icon is lit.
+ bool toggled_;
+
+ DISALLOW_COPY_AND_ASSIGN(TranslateDecoration);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_

Powered by Google App Engine
This is Rietveld 408576698