| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2013 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 |
| 14 class TranslateDecoration : public ImageDecoration { |
| 15 public: |
| 16 explicit TranslateDecoration(CommandUpdater* command_updater); |
| 17 virtual ~TranslateDecoration(); |
| 18 |
| 19 // Toggles the icon on or off. |
| 20 void SetLit(bool on); |
| 21 |
| 22 // Get the point where the translate bubble should point within the |
| 23 // decoration's frame. |
| 24 NSPoint GetBubblePointInFrame(NSRect frame); |
| 25 |
| 26 private: |
| 27 // Implement |LocationBarDecoration| |
| 28 virtual bool AcceptsMousePress() OVERRIDE; |
| 29 virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
| 30 virtual NSString* GetToolTip() OVERRIDE; |
| 31 |
| 32 // For showing the translate bubble up. |
| 33 CommandUpdater* command_updater_; // Weak, owned by Browser. |
| 34 |
| 35 // Whether the translate icon is lit. |
| 36 bool is_lit_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(TranslateDecoration); |
| 39 }; |
| 40 |
| 41 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_ |
| OLD | NEW |