Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / location_bar / translate_decoration.h
blob1d7f484981b92a9373434cadc84ebb561d24e419
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.
5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_
8 #import <Cocoa/Cocoa.h>
10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
12 class CommandUpdater;
13 @class TranslateBubbleController;
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 ~TranslateDecoration() override;
23 // Toggles the icon on or off.
24 void SetLit(bool on);
26 // Implement |LocationBarDecoration|
27 bool AcceptsMousePress() override;
28 bool OnMousePressed(NSRect frame, NSPoint location) override;
29 NSString* GetToolTip() override;
30 NSPoint GetBubblePointInFrame(NSRect frame) override;
32 private:
33 // For showing the translate bubble up.
34 CommandUpdater* command_updater_; // Weak, owned by Browser.
36 DISALLOW_COPY_AND_ASSIGN(TranslateDecoration);
39 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_