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