OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |