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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tabs/tab.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 throbber_->ResetStartTimes(); 1451 throbber_->ResetStartTimes();
1452 throbber_->SetVisible(false); 1452 throbber_->SetVisible(false);
1453 ScheduleIconPaint(); 1453 ScheduleIconPaint();
1454 return; 1454 return;
1455 } 1455 }
1456 1456
1457 // Since the throbber can animate for a long time, paint to a separate layer 1457 // Since the throbber can animate for a long time, paint to a separate layer
1458 // when possible to reduce repaint overhead. 1458 // when possible to reduce repaint overhead.
1459 const bool paint_to_layer = controller_->CanPaintThrobberToLayer(); 1459 const bool paint_to_layer = controller_->CanPaintThrobberToLayer();
1460 if (paint_to_layer != !!throbber_->layer()) { 1460 if (paint_to_layer != !!throbber_->layer()) {
1461 throbber_->SetPaintToLayer(paint_to_layer);
1462 if (paint_to_layer) { 1461 if (paint_to_layer) {
1462 throbber_->SetPaintToLayer();
1463 throbber_->layer()->SetFillsBoundsOpaquely(false); 1463 throbber_->layer()->SetFillsBoundsOpaquely(false);
1464 ScheduleIconPaint(); // Ensure the non-layered throbber goes away. 1464 ScheduleIconPaint(); // Ensure the non-layered throbber goes away.
1465 } else {
1466 throbber_->DestroyLayer();
1465 } 1467 }
1466 } 1468 }
1467 if (!throbber_->visible()) { 1469 if (!throbber_->visible()) {
1468 ScheduleIconPaint(); // Repaint the icon area to hide the favicon. 1470 ScheduleIconPaint(); // Repaint the icon area to hide the favicon.
1469 throbber_->SetVisible(true); 1471 throbber_->SetVisible(true);
1470 } 1472 }
1471 throbber_->SchedulePaint(); 1473 throbber_->SchedulePaint();
1472 } 1474 }
1473 1475
1474 int Tab::IconCapacity() const { 1476 int Tab::IconCapacity() const {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 SchedulePaintInRect(bounds); 1584 SchedulePaintInRect(bounds);
1583 } 1585 }
1584 1586
1585 gfx::Rect Tab::GetImmersiveBarRect() const { 1587 gfx::Rect Tab::GetImmersiveBarRect() const {
1586 // The main bar is as wide as the normal tab's horizontal top line. 1588 // The main bar is as wide as the normal tab's horizontal top line.
1587 gfx::Rect contents = GetContentsBounds(); 1589 gfx::Rect contents = GetContentsBounds();
1588 contents.set_y(0); 1590 contents.set_y(0);
1589 contents.set_height(kImmersiveBarHeight); 1591 contents.set_height(kImmersiveBarHeight);
1590 return contents; 1592 return contents;
1591 } 1593 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698