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 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 void ToolbarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 187 void ToolbarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
188 SetPaintToLayer(true); | 188 SetPaintToLayer(true); |
189 SetFillsBoundsOpaquely(false); | 189 SetFillsBoundsOpaquely(false); |
190 image()->SetPaintToLayer(true); | 190 image()->SetPaintToLayer(true); |
191 image()->SetFillsBoundsOpaquely(false); | 191 image()->SetFillsBoundsOpaquely(false); |
192 | 192 |
193 layer()->Add(ink_drop_layer); | 193 layer()->Add(ink_drop_layer); |
194 layer()->StackAtBottom(ink_drop_layer); | 194 layer()->StackAtBottom(ink_drop_layer); |
195 | |
196 // Invalidates the contents of the parent's layer which may contain | |
197 // a stale close/reload icon that should not remain visible. | |
198 parent()->SchedulePaint(); | |
199 } | 195 } |
200 | 196 |
201 void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 197 void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
202 layer()->Remove(ink_drop_layer); | 198 layer()->Remove(ink_drop_layer); |
203 | 199 |
204 image()->SetFillsBoundsOpaquely(true); | 200 image()->SetFillsBoundsOpaquely(true); |
205 image()->SetPaintToLayer(false); | 201 image()->SetPaintToLayer(false); |
206 SetPaintToLayer(false); | 202 SetPaintToLayer(false); |
207 } | 203 } |
208 | 204 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 SetState(STATE_NORMAL); | 295 SetState(STATE_NORMAL); |
300 } | 296 } |
301 | 297 |
302 const char* ToolbarButton::GetClassName() const { | 298 const char* ToolbarButton::GetClassName() const { |
303 return "ToolbarButton"; | 299 return "ToolbarButton"; |
304 } | 300 } |
305 | 301 |
306 gfx::Point ToolbarButton::CalculateInkDropCenter() const { | 302 gfx::Point ToolbarButton::CalculateInkDropCenter() const { |
307 return GetLocalBounds().CenterPoint(); | 303 return GetLocalBounds().CenterPoint(); |
308 } | 304 } |
OLD | NEW |