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

Side by Side Diff: ash/system/status_area_widget_delegate.cc

Issue 10668009: UI refinement for left/right ash tray and bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/status_area_widget_delegate.h ('k') | ash/system/tray/system_tray.cc » ('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 (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 "ash/system/status_area_widget_delegate.h" 5 #include "ash/system/status_area_widget_delegate.h"
6 6
7 #include "ash/ash_export.h" 7 #include "ash/ash_export.h"
8 #include "ash/focus_cycler.h" 8 #include "ash/focus_cycler.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 0, /* resize percent */ 103 0, /* resize percent */
104 views::GridLayout::USE_PREF, 0, 0); 104 views::GridLayout::USE_PREF, 0, 0);
105 for (int c = 0; c < child_count(); ++c) { 105 for (int c = 0; c < child_count(); ++c) {
106 if (c != 0) 106 if (c != 0)
107 layout->AddPaddingRow(0, kTraySpacing); 107 layout->AddPaddingRow(0, kTraySpacing);
108 layout->StartRow(0, 0); 108 layout->StartRow(0, 0);
109 layout->AddView(child_at(c)); 109 layout->AddView(child_at(c));
110 } 110 }
111 } 111 }
112 Layout(); 112 Layout();
113 UpdateWidgetSize();
113 } 114 }
114 115
115 void StatusAreaWidgetDelegate::ChildPreferredSizeChanged(View* child) { 116 void StatusAreaWidgetDelegate::ChildPreferredSizeChanged(View* child) {
116 // Need to resize the window when trays or items are added/removed. 117 // Need to resize the window when trays or items are added/removed.
118 UpdateWidgetSize();
119 }
120
121 void StatusAreaWidgetDelegate::UpdateWidgetSize() {
117 if (GetWidget()) 122 if (GetWidget())
118 GetWidget()->SetSize(GetPreferredSize()); 123 GetWidget()->SetSize(GetPreferredSize());
119 } 124 }
120 125
121 } // namespace internal 126 } // namespace internal
122 } // namespace ash 127 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/status_area_widget_delegate.h ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698