| 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_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void OnWidgetDestroying(views::Widget* widget) override; | 81 void OnWidgetDestroying(views::Widget* widget) override; |
| 82 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; | 82 void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 // Calls OnExecuting and runs |command_id_| with a valid |command_updater_|. | 85 // Calls OnExecuting and runs |command_id_| with a valid |command_updater_|. |
| 86 virtual void ExecuteCommand(ExecuteSource source); | 86 virtual void ExecuteCommand(ExecuteSource source); |
| 87 | 87 |
| 88 // Returns the bubble instance for the icon. | 88 // Returns the bubble instance for the icon. |
| 89 virtual views::BubbleDialogDelegateView* GetBubble() const = 0; | 89 virtual views::BubbleDialogDelegateView* GetBubble() const = 0; |
| 90 | 90 |
| 91 // Gets the given vector icon in the correct color and size based on |active| | 91 // Gets the given vector icon in the correct color and size based on |active|. |
| 92 // and whether Chrome's in material design mode. | |
| 93 virtual gfx::VectorIconId GetVectorIcon() const; | 92 virtual gfx::VectorIconId GetVectorIcon() const; |
| 94 | 93 |
| 95 // Sets the image using a PNG from the resource bundle. Returns true if an | |
| 96 // image was set, or false if the icon should use a vector asset. This only | |
| 97 // exists for non-MD mode. TODO(estade): remove it. | |
| 98 virtual bool SetRasterIcon(); | |
| 99 | |
| 100 // views::View: | 94 // views::View: |
| 101 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 95 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 102 | 96 |
| 103 // Updates the icon after some state has changed. | 97 // Updates the icon after some state has changed. |
| 104 void UpdateIcon(); | 98 void UpdateIcon(); |
| 105 | 99 |
| 106 // Sets the active state of the icon. An active icon will be displayed in a | 100 // Sets the active state of the icon. An active icon will be displayed in a |
| 107 // "call to action" color. | 101 // "call to action" color. |
| 108 void SetActiveInternal(bool active); | 102 void SetActiveInternal(bool active); |
| 109 | 103 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 126 | 120 |
| 127 // This is used to check if the bookmark bubble was showing during the mouse | 121 // This is used to check if the bookmark bubble was showing during the mouse |
| 128 // pressed event. If this is true then the mouse released event is ignored to | 122 // pressed event. If this is true then the mouse released event is ignored to |
| 129 // prevent the bubble from reshowing. | 123 // prevent the bubble from reshowing. |
| 130 bool suppress_mouse_released_action_; | 124 bool suppress_mouse_released_action_; |
| 131 | 125 |
| 132 DISALLOW_COPY_AND_ASSIGN(BubbleIconView); | 126 DISALLOW_COPY_AND_ASSIGN(BubbleIconView); |
| 133 }; | 127 }; |
| 134 | 128 |
| 135 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ | 129 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ |
| OLD | NEW |