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

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: Changed doc comment in View::CreateLayer(). Created 4 years, 11 months 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.h » ('j') | no next file with comments »
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698