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

Side by Side 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: groby's review 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
11
12 class CommandUpdater;
13 @class TranslateBubbleController;
14
15 // Translate icon on the right side of the field. This appears when
16 // translation is available on the current page. This icon is lit when
17 // translation is already done, otherwise not lit.
18 class TranslateDecoration : public ImageDecoration {
19 public:
20 explicit TranslateDecoration(CommandUpdater* command_updater);
21 virtual ~TranslateDecoration();
22
23 // Toggles the icon on or off.
24 void SetLit(bool on);
25
26 // Get the point where the translate bubble should point within the
27 // decoration's frame.
28 NSPoint GetBubblePointInFrame(NSRect frame);
29
30 private:
31 // Implement |LocationBarDecoration|
32 virtual bool AcceptsMousePress() OVERRIDE;
33 virtual bool OnMousePressed(NSRect frame) OVERRIDE;
34 virtual NSString* GetToolTip() OVERRIDE;
35
36 // For showing the translate bubble up.
37 CommandUpdater* command_updater_; // Weak, owned by Browser.
38
39 // Whether the translate icon is lit.
40 bool is_lit_;
41
42 DISALLOW_COPY_AND_ASSIGN(TranslateDecoration);
43 };
44
45 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698