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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_button.cc

Issue 1461673002: Moved parent_->SchedulePaint() to Views::SetFillsBoundsOpaquely() and Views::SchedulePaint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed parent()->SchedulePaint() from ToolbarButton::AddInkDropLayer(). Created 5 years, 1 month 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
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | ui/views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698