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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 223 } |
224 | 224 |
225 void ToolbarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 225 void ToolbarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
226 SetPaintToLayer(true); | 226 SetPaintToLayer(true); |
227 SetFillsBoundsOpaquely(false); | 227 SetFillsBoundsOpaquely(false); |
228 image()->SetPaintToLayer(true); | 228 image()->SetPaintToLayer(true); |
229 image()->SetFillsBoundsOpaquely(false); | 229 image()->SetFillsBoundsOpaquely(false); |
230 | 230 |
231 layer()->Add(ink_drop_layer); | 231 layer()->Add(ink_drop_layer); |
232 layer()->StackAtBottom(ink_drop_layer); | 232 layer()->StackAtBottom(ink_drop_layer); |
| 233 |
| 234 // Invalidates the contents of the parent's layer which may contain |
| 235 // a stale close/reload icon that should not remain visible. |
| 236 parent()->SchedulePaint(); |
233 } | 237 } |
234 | 238 |
235 void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 239 void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
236 layer()->Remove(ink_drop_layer); | 240 layer()->Remove(ink_drop_layer); |
237 | 241 |
238 image()->SetFillsBoundsOpaquely(true); | 242 image()->SetFillsBoundsOpaquely(true); |
239 image()->SetPaintToLayer(false); | 243 image()->SetPaintToLayer(false); |
240 SetPaintToLayer(false); | 244 SetPaintToLayer(false); |
241 } | 245 } |
242 | 246 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 SetState(STATE_NORMAL); | 350 SetState(STATE_NORMAL); |
347 } | 351 } |
348 | 352 |
349 const char* ToolbarButton::GetClassName() const { | 353 const char* ToolbarButton::GetClassName() const { |
350 return "ToolbarButton"; | 354 return "ToolbarButton"; |
351 } | 355 } |
352 | 356 |
353 gfx::Point ToolbarButton::CalculateInkDropCenter() const { | 357 gfx::Point ToolbarButton::CalculateInkDropCenter() const { |
354 return GetLocalBounds().CenterPoint(); | 358 return GetLocalBounds().CenterPoint(); |
355 } | 359 } |
OLD | NEW |