Chromium Code Reviews| 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_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | |
| 7 | |
| 8 #include "ui/views/controls/image_view.h" | |
| 9 | |
| 10 class BubbleIconViewDelegate; | |
| 11 class CommandUpdater; | |
| 12 | |
| 13 // The icon on the Omnibox which can show a bubble when the user click this. | |
|
sky
2013/10/23 14:43:29
Represents an icon on the omnibox that shows a bub
hajimehoshi
2013/10/24 11:31:14
Done.
| |
| 14 class BubbleIconView : public views::ImageView { | |
| 15 public: | |
| 16 explicit BubbleIconView(CommandUpdater* command_updater, int command_id); | |
| 17 virtual ~BubbleIconView(); | |
| 18 | |
| 19 protected: | |
| 20 BubbleIconViewDelegate* delegate() { return delegate_; } | |
| 21 void set_delegate(BubbleIconViewDelegate* delegate) { delegate_ = delegate; } | |
| 22 | |
| 23 private: | |
| 24 // views::ImageView: | |
| 25 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | |
| 26 virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) | |
| 27 const OVERRIDE; | |
| 28 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | |
| 29 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | |
| 30 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | |
| 31 | |
| 32 // ui::EventHandler: | |
| 33 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | |
| 34 | |
| 35 // The CommandUpdater for the Browser object that owns the location bar. | |
| 36 CommandUpdater* command_updater_; | |
| 37 | |
| 38 // The command ID executed when the user clicks this icon. | |
| 39 const int command_id_; | |
| 40 | |
| 41 // This is used to check if the bookmark bubble was showing during the mouse | |
| 42 // pressed event. If this is true then the mouse released event is ignored to | |
| 43 // prevent the bubble from reshowing. | |
| 44 bool suppress_mouse_released_action_; | |
| 45 | |
| 46 // The delegate of this object. | |
| 47 BubbleIconViewDelegate* delegate_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(BubbleIconView); | |
| 50 }; | |
| 51 | |
| 52 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | |
| OLD | NEW |