OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... | |
28 } | 28 } |
29 | 29 |
30 // PageActionImageView is used by the LocationBarView to display the icon for a | 30 // PageActionImageView is used by the LocationBarView to display the icon for a |
31 // given PageAction and notify the extension when the icon is clicked. | 31 // given PageAction and notify the extension when the icon is clicked. |
32 class PageActionImageView : public views::ImageView, | 32 class PageActionImageView : public views::ImageView, |
33 public ExtensionContextMenuModel::PopupDelegate, | 33 public ExtensionContextMenuModel::PopupDelegate, |
34 public views::WidgetObserver, | 34 public views::WidgetObserver, |
35 public views::ContextMenuController, | 35 public views::ContextMenuController, |
36 public ExtensionActionIconFactory::Observer { | 36 public ExtensionActionIconFactory::Observer { |
37 public: | 37 public: |
38 static const char kViewClassName[]; | |
sky
2014/08/04 17:36:54
nit: there isn't a need to make this public unless
tdanderson
2014/08/05 15:32:32
Done.
| |
39 | |
38 PageActionImageView(LocationBarView* owner, | 40 PageActionImageView(LocationBarView* owner, |
39 ExtensionAction* page_action, | 41 ExtensionAction* page_action, |
40 Browser* browser); | 42 Browser* browser); |
41 virtual ~PageActionImageView(); | 43 virtual ~PageActionImageView(); |
42 | 44 |
43 ExtensionAction* page_action() { return page_action_; } | 45 ExtensionAction* page_action() { return page_action_; } |
44 | 46 |
45 int current_tab_id() { return current_tab_id_; } | 47 int current_tab_id() { return current_tab_id_; } |
46 | 48 |
47 void set_preview_enabled(bool preview_enabled) { | 49 void set_preview_enabled(bool preview_enabled) { |
48 preview_enabled_ = preview_enabled; | 50 preview_enabled_ = preview_enabled; |
49 } | 51 } |
50 | 52 |
51 // Overridden from views::View: | 53 // Overridden from views::View: |
54 virtual const char* GetClassName() const OVERRIDE; | |
52 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 55 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
53 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 56 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
54 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 57 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
55 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 58 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
59 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | |
56 | 60 |
57 // Overridden from ExtensionContextMenuModel::Delegate | 61 // Overridden from ExtensionContextMenuModel::Delegate |
58 virtual void InspectPopup() OVERRIDE; | 62 virtual void InspectPopup() OVERRIDE; |
59 | 63 |
60 // Overridden from views::WidgetObserver: | 64 // Overridden from views::WidgetObserver: |
61 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 65 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
62 | 66 |
63 // Overridden from views::ContextMenuController. | 67 // Overridden from views::ContextMenuController. |
64 virtual void ShowContextMenuForView(View* source, | 68 virtual void ShowContextMenuForView(View* source, |
65 const gfx::Point& point, | 69 const gfx::Point& point, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 // The extension command accelerator this page action is listening for (to | 131 // The extension command accelerator this page action is listening for (to |
128 // show the popup). | 132 // show the popup). |
129 scoped_ptr<ui::Accelerator> page_action_keybinding_; | 133 scoped_ptr<ui::Accelerator> page_action_keybinding_; |
130 | 134 |
131 scoped_ptr<views::MenuRunner> menu_runner_; | 135 scoped_ptr<views::MenuRunner> menu_runner_; |
132 | 136 |
133 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); | 137 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); |
134 }; | 138 }; |
135 | 139 |
136 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 140 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
OLD | NEW |