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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2427313003: Move the 'Exit session' button to the most left side in the system tray. (Closed)
Patch Set: Add owner Created 4 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 | ash/common/system/status_area_widget.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/system/chromeos/palette/palette_tray.h" 5 #include "ash/common/system/chromeos/palette/palette_tray.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/shelf/shelf_constants.h" 8 #include "ash/common/shelf/shelf_constants.h"
9 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/shelf/wm_shelf_util.h" 10 #include "ash/common/shelf/wm_shelf_util.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 // Move the palette to the left so the right edge of the palette aligns with 321 // Move the palette to the left so the right edge of the palette aligns with
322 // the right edge of the tray button. 322 // the right edge of the tray button.
323 if (IsHorizontalAlignment(shelf_alignment())) { 323 if (IsHorizontalAlignment(shelf_alignment())) {
324 // TODO(jdufault): Figure out a more robust adjustment method that does not 324 // TODO(jdufault): Figure out a more robust adjustment method that does not
325 // break in md-shelf. 325 // break in md-shelf.
326 int icon_size = tray_container()->width(); 326 int icon_size = tray_container()->width();
327 if (tray_container()->border()) 327 if (tray_container()->border())
328 icon_size -= tray_container()->border()->GetInsets().width(); 328 icon_size -= tray_container()->border()->GetInsets().width();
329 329
330 r.Offset(-r.width() + icon_size, 0); 330 r.Offset(-r.width() + icon_size + x(), 0);
331 } else { 331 } else {
332 // Vertical layout doesn't need the border adjustment that horizontal needs. 332 // Vertical layout doesn't need the border adjustment that horizontal needs.
333 r.Offset(0, -r.height() + tray_container()->height()); 333 r.Offset(0, -r.height() + tray_container()->height());
334 } 334 }
335 335
336 return r; 336 return r;
337 } 337 }
338 338
339 void PaletteTray::OnBeforeBubbleWidgetInit( 339 void PaletteTray::OnBeforeBubbleWidgetInit(
340 views::Widget* anchor_widget, 340 views::Widget* anchor_widget,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } else { 457 } else {
458 UpdateIconVisibility(); 458 UpdateIconVisibility();
459 } 459 }
460 } 460 }
461 461
462 void PaletteTray::UpdateIconVisibility() { 462 void PaletteTray::UpdateIconVisibility() {
463 SetVisible(IsInUserSession()); 463 SetVisible(IsInUserSession());
464 } 464 }
465 465
466 } // namespace ash 466 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/status_area_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698