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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 preview_enabled_ = preview_enabled; | 34 preview_enabled_ = preview_enabled; |
35 } | 35 } |
36 ExtensionAction* extension_action() { | 36 ExtensionAction* extension_action() { |
37 return view_controller_->extension_action(); | 37 return view_controller_->extension_action(); |
38 } | 38 } |
39 ExtensionActionViewController* view_controller() { | 39 ExtensionActionViewController* view_controller() { |
40 return view_controller_.get(); | 40 return view_controller_.get(); |
41 } | 41 } |
42 | 42 |
43 // Overridden from views::View: | 43 // Overridden from views::View: |
44 virtual const char* GetClassName() const OVERRIDE; | 44 virtual const char* GetClassName() const override; |
45 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 45 virtual void GetAccessibleState(ui::AXViewState* state) override; |
46 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 46 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
47 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 47 virtual void OnMouseReleased(const ui::MouseEvent& event) override; |
48 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 48 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
49 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | 49 virtual void OnGestureEvent(ui::GestureEvent* event) override; |
50 | 50 |
51 // Called to notify the PageAction that it should determine whether to be | 51 // Called to notify the PageAction that it should determine whether to be |
52 // visible or hidden. |contents| is the WebContents that is active. | 52 // visible or hidden. |contents| is the WebContents that is active. |
53 void UpdateVisibility(content::WebContents* contents); | 53 void UpdateVisibility(content::WebContents* contents); |
54 | 54 |
55 private: | 55 private: |
56 static const char kViewClassName[]; | 56 static const char kViewClassName[]; |
57 | 57 |
58 // Overridden from View. | 58 // Overridden from View. |
59 virtual void PaintChildren(gfx::Canvas* canvas, | 59 virtual void PaintChildren(gfx::Canvas* canvas, |
60 const views::CullSet& cull_set) OVERRIDE; | 60 const views::CullSet& cull_set) override; |
61 | 61 |
62 // Overridden from ExtensionActionViewDelegate: | 62 // Overridden from ExtensionActionViewDelegate: |
63 virtual void OnIconUpdated() OVERRIDE; | 63 virtual void OnIconUpdated() override; |
64 virtual views::View* GetAsView() OVERRIDE; | 64 virtual views::View* GetAsView() override; |
65 virtual bool IsShownInMenu() OVERRIDE; | 65 virtual bool IsShownInMenu() override; |
66 virtual views::FocusManager* GetFocusManagerForAccelerator() OVERRIDE; | 66 virtual views::FocusManager* GetFocusManagerForAccelerator() override; |
67 virtual views::Widget* GetParentForContextMenu() OVERRIDE; | 67 virtual views::Widget* GetParentForContextMenu() override; |
68 virtual ExtensionActionViewController* GetPreferredPopupViewController() | 68 virtual ExtensionActionViewController* GetPreferredPopupViewController() |
69 OVERRIDE; | 69 override; |
70 virtual views::View* GetReferenceViewForPopup() OVERRIDE; | 70 virtual views::View* GetReferenceViewForPopup() override; |
71 virtual views::MenuButton* GetContextMenuButton() OVERRIDE; | 71 virtual views::MenuButton* GetContextMenuButton() override; |
72 virtual content::WebContents* GetCurrentWebContents() OVERRIDE; | 72 virtual content::WebContents* GetCurrentWebContents() override; |
73 virtual void HideActivePopup() OVERRIDE; | 73 virtual void HideActivePopup() override; |
74 | 74 |
75 // The controller for this ExtensionAction view. | 75 // The controller for this ExtensionAction view. |
76 scoped_ptr<ExtensionActionViewController> view_controller_; | 76 scoped_ptr<ExtensionActionViewController> view_controller_; |
77 | 77 |
78 // The location bar view that owns us. | 78 // The location bar view that owns us. |
79 LocationBarView* owner_; | 79 LocationBarView* owner_; |
80 | 80 |
81 // The string to show for a tooltip; | 81 // The string to show for a tooltip; |
82 std::string tooltip_; | 82 std::string tooltip_; |
83 | 83 |
84 // This is used for post-install visual feedback. The page_action icon is | 84 // This is used for post-install visual feedback. The page_action icon is |
85 // briefly shown even if it hasn't been enabled by its extension. | 85 // briefly shown even if it hasn't been enabled by its extension. |
86 bool preview_enabled_; | 86 bool preview_enabled_; |
87 | 87 |
88 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); | 88 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); |
89 }; | 89 }; |
90 | 90 |
91 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 91 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
OLD | NEW |