Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Side by Side Diff: chrome/browser/ui/views/location_bar/bubble_icon_view.h

Issue 1682893002: Color the ink drop ripple and hover effects based on theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit tests Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "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/image/image_skia.h" 10 #include "ui/gfx/image/image_skia.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void ViewHierarchyChanged( 66 void ViewHierarchyChanged(
67 const ViewHierarchyChangedDetails& details) override; 67 const ViewHierarchyChangedDetails& details) override;
68 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 68 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
69 69
70 // ui::EventHandler: 70 // ui::EventHandler:
71 void OnGestureEvent(ui::GestureEvent* event) override; 71 void OnGestureEvent(ui::GestureEvent* event) override;
72 72
73 // views::InkDropHost: 73 // views::InkDropHost:
74 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; 74 void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
75 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; 75 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
76 gfx::Point CalculateInkDropCenter() const override;
77 bool ShouldShowInkDropHover() const override;
78 SkColor GetInkDropBaseColor() const override;
76 79
77 // views::WidgetObserver: 80 // views::WidgetObserver:
78 void OnWidgetDestroying(views::Widget* widget) override; 81 void OnWidgetDestroying(views::Widget* widget) override;
79 void OnWidgetVisibilityChanged(views::Widget* widget, 82 void OnWidgetVisibilityChanged(views::Widget* widget,
80 bool visible) override; 83 bool visible) override;
81 84
82 protected: 85 protected:
83 // Calls OnExecuting and runs |command_id_| with a valid |command_updater_|. 86 // Calls OnExecuting and runs |command_id_| with a valid |command_updater_|.
84 virtual void ExecuteCommand(ExecuteSource source); 87 virtual void ExecuteCommand(ExecuteSource source);
85 88
86 // Returns the bubble instance for the icon. 89 // Returns the bubble instance for the icon.
87 virtual views::BubbleDelegateView* GetBubble() const = 0; 90 virtual views::BubbleDelegateView* GetBubble() const = 0;
88 91
89 // Gets the given vector icon in the correct color and size based on |active| 92 // Gets the given vector icon in the correct color and size based on |active|
90 // and whether Chrome's in material design mode. 93 // and whether Chrome's in material design mode.
91 virtual gfx::VectorIconId GetVectorIcon() const; 94 virtual gfx::VectorIconId GetVectorIcon() const;
92 95
93 // Sets the image using a PNG from the resource bundle. Returns true if an 96 // Sets the image using a PNG from the resource bundle. Returns true if an
94 // image was set, or false if the icon should use a vector asset. This only 97 // image was set, or false if the icon should use a vector asset. This only
95 // exists for non-MD mode. TODO(estade): remove it. 98 // exists for non-MD mode. TODO(estade): remove it.
96 virtual bool SetRasterIcon(); 99 virtual bool SetRasterIcon();
97 100
98 // views::View: 101 // views::View:
99 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; 102 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
100 103
101 // views::InkDropHost:
102 gfx::Point CalculateInkDropCenter() const override;
103 bool ShouldShowInkDropHover() const override;
104
105 // Updates the icon after some state has changed. 104 // Updates the icon after some state has changed.
106 void UpdateIcon(); 105 void UpdateIcon();
107 106
108 // Sets the active state of the icon. An active icon will be displayed in a 107 // Sets the active state of the icon. An active icon will be displayed in a
109 // "call to action" color. 108 // "call to action" color.
110 void SetActiveInternal(bool active); 109 void SetActiveInternal(bool active);
111 110
112 bool active() const { return active_; } 111 bool active() const { return active_; }
113 112
114 private: 113 private:
(...skipping 16 matching lines...) Expand all
131 // prevent the bubble from reshowing. 130 // prevent the bubble from reshowing.
132 bool suppress_mouse_released_action_; 131 bool suppress_mouse_released_action_;
133 132
134 // Animation delegate for the ink drop ripple effect. 133 // Animation delegate for the ink drop ripple effect.
135 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_; 134 scoped_ptr<views::InkDropDelegate> ink_drop_delegate_;
136 135
137 DISALLOW_COPY_AND_ASSIGN(BubbleIconView); 136 DISALLOW_COPY_AND_ASSIGN(BubbleIconView);
138 }; 137 };
139 138
140 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_ 139 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698