Chromium Code Reviews| 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..62e4f29f46a6271fd84a5fff9473c3e4609438c5 |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/location_bar/translate_decoration.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2014 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 TranslateBubbleController; |
| + |
| +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.
|
| + public: |
| + explicit TranslateDecoration(CommandUpdater* command_updater); |
| + virtual ~TranslateDecoration(); |
| + |
| + // Toggles the icon on or off. |
| + void SetLit(bool on); |
| + |
| + // 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 is_lit_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TranslateDecoration); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_TRANSLATE_DECORATION_H_ |