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

Unified Diff: ash/wm/status_area_layout_manager.cc

Issue 9877009: Two tweaks to avoid invoking ShelfLayoutManager::LayoutShelf unless we (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/image_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/status_area_layout_manager.cc
diff --git a/ash/wm/status_area_layout_manager.cc b/ash/wm/status_area_layout_manager.cc
index 05f6fde719432817a9af34614d6af244429a5cb9..616de1781afbf722ef286b48d14a402a5c323d22 100644
--- a/ash/wm/status_area_layout_manager.cc
+++ b/ash/wm/status_area_layout_manager.cc
@@ -6,6 +6,8 @@
#include "ash/wm/shelf_layout_manager.h"
#include "base/auto_reset.h"
+#include "ui/aura/window.h"
+#include "ui/views/widget/widget.h"
namespace ash {
namespace internal {
@@ -40,10 +42,22 @@ void StatusAreaLayoutManager::OnChildWindowVisibilityChanged(
}
void StatusAreaLayoutManager::SetChildBounds(
- aura::Window* child, const gfx::Rect& requested_bounds) {
+ aura::Window* child,
+ const gfx::Rect& requested_bounds) {
+ // Only need to have the shelf do a layout if the child changing is the status
+ // area and the shelf isn't in the process of doing a layout.
+ if (child != shelf_->status()->GetNativeView() || in_layout_) {
+ SetChildBoundsDirect(child, requested_bounds);
+ return;
+ }
+
+ // If the size matches, no need to do anything. We don't check the location as
+ // that is managed by the shelf.
+ if (requested_bounds.size() == child->bounds().size())
+ return;
+
SetChildBoundsDirect(child, requested_bounds);
- if (!in_layout_)
- LayoutStatusArea();
+ LayoutStatusArea();
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | ui/views/controls/image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698