| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_TOOLBAR_TOOLBAR_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 gfx::Size GetPreferredSize() const override; | 47 gfx::Size GetPreferredSize() const override; |
| 48 bool OnMousePressed(const ui::MouseEvent& event) override; | 48 bool OnMousePressed(const ui::MouseEvent& event) override; |
| 49 bool OnMouseDragged(const ui::MouseEvent& event) override; | 49 bool OnMouseDragged(const ui::MouseEvent& event) override; |
| 50 void OnMouseReleased(const ui::MouseEvent& event) override; | 50 void OnMouseReleased(const ui::MouseEvent& event) override; |
| 51 // Showing the drop down results in a MouseCaptureLost, we need to ignore it. | 51 // Showing the drop down results in a MouseCaptureLost, we need to ignore it. |
| 52 void OnMouseCaptureLost() override; | 52 void OnMouseCaptureLost() override; |
| 53 void OnMouseExited(const ui::MouseEvent& event) override; | 53 void OnMouseExited(const ui::MouseEvent& event) override; |
| 54 void OnGestureEvent(ui::GestureEvent* event) override; | 54 void OnGestureEvent(ui::GestureEvent* event) override; |
| 55 void GetAccessibleState(ui::AXViewState* state) override; | 55 void GetAccessibleState(ui::AXViewState* state) override; |
| 56 scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const override; | 56 scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const override; |
| 57 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; | |
| 58 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; | |
| 59 | 57 |
| 60 // views::ContextMenuController: | 58 // views::ContextMenuController: |
| 61 void ShowContextMenuForView(View* source, | 59 void ShowContextMenuForView(View* source, |
| 62 const gfx::Point& point, | 60 const gfx::Point& point, |
| 63 ui::MenuSourceType source_type) override; | 61 ui::MenuSourceType source_type) override; |
| 64 | 62 |
| 65 protected: | 63 protected: |
| 66 // Returns if menu should be shown. Override this to change default behavior. | 64 // Returns if menu should be shown. Override this to change default behavior. |
| 67 virtual bool ShouldShowMenu(); | 65 virtual bool ShouldShowMenu(); |
| 68 | 66 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 91 // Controls the visual feedback for the button state. | 89 // Controls the visual feedback for the button state. |
| 92 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_; | 90 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_; |
| 93 | 91 |
| 94 // A factory for tasks that show the dropdown context menu for the button. | 92 // A factory for tasks that show the dropdown context menu for the button. |
| 95 base::WeakPtrFactory<ToolbarButton> show_menu_factory_; | 93 base::WeakPtrFactory<ToolbarButton> show_menu_factory_; |
| 96 | 94 |
| 97 DISALLOW_COPY_AND_ASSIGN(ToolbarButton); | 95 DISALLOW_COPY_AND_ASSIGN(ToolbarButton); |
| 98 }; | 96 }; |
| 99 | 97 |
| 100 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ | 98 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| OLD | NEW |