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