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(); | |
237 } | 233 } |
238 | 234 |
239 void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 235 void ToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
240 layer()->Remove(ink_drop_layer); | 236 layer()->Remove(ink_drop_layer); |
241 | 237 |
242 image()->SetFillsBoundsOpaquely(true); | 238 image()->SetFillsBoundsOpaquely(true); |
243 image()->SetPaintToLayer(false); | 239 image()->SetPaintToLayer(false); |
244 SetPaintToLayer(false); | 240 SetPaintToLayer(false); |
245 } | 241 } |
246 | 242 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 SetState(STATE_NORMAL); | 346 SetState(STATE_NORMAL); |
351 } | 347 } |
352 | 348 |
353 const char* ToolbarButton::GetClassName() const { | 349 const char* ToolbarButton::GetClassName() const { |
354 return "ToolbarButton"; | 350 return "ToolbarButton"; |
355 } | 351 } |
356 | 352 |
357 gfx::Point ToolbarButton::CalculateInkDropCenter() const { | 353 gfx::Point ToolbarButton::CalculateInkDropCenter() const { |
358 return GetLocalBounds().CenterPoint(); | 354 return GetLocalBounds().CenterPoint(); |
359 } | 355 } |
OLD | NEW |