| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cast/tray_cast.h" | 5 #include "ash/system/cast/tray_cast.h" |
| 6 | 6 |
| 7 #include "ash/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
| 8 #include "ash/shelf/shelf_types.h" | 8 #include "ash/shelf/shelf_types.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/chromeos/screen_security/screen_tray_item.h" | 10 #include "ash/system/chromeos/screen_security/screen_tray_item.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 } | 353 } |
| 354 | 354 |
| 355 CastTrayView::~CastTrayView() { | 355 CastTrayView::~CastTrayView() { |
| 356 } | 356 } |
| 357 | 357 |
| 358 void CastTrayView::UpdateAlignment(ShelfAlignment alignment) { | 358 void CastTrayView::UpdateAlignment(ShelfAlignment alignment) { |
| 359 // Center the item dependent on the orientation of the shelf. | 359 // Center the item dependent on the orientation of the shelf. |
| 360 views::BoxLayout::Orientation layout = views::BoxLayout::kHorizontal; | 360 views::BoxLayout::Orientation layout = views::BoxLayout::kHorizontal; |
| 361 switch (alignment) { | 361 switch (alignment) { |
| 362 case ash::SHELF_ALIGNMENT_BOTTOM: | 362 case ash::SHELF_ALIGNMENT_BOTTOM: |
| 363 case ash::SHELF_ALIGNMENT_TOP: | |
| 364 layout = views::BoxLayout::kHorizontal; | 363 layout = views::BoxLayout::kHorizontal; |
| 365 break; | 364 break; |
| 366 case ash::SHELF_ALIGNMENT_LEFT: | 365 case ash::SHELF_ALIGNMENT_LEFT: |
| 367 case ash::SHELF_ALIGNMENT_RIGHT: | 366 case ash::SHELF_ALIGNMENT_RIGHT: |
| 368 layout = views::BoxLayout::kVertical; | 367 layout = views::BoxLayout::kVertical; |
| 369 break; | 368 break; |
| 370 } | 369 } |
| 371 SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); | 370 SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); |
| 372 Layout(); | 371 Layout(); |
| 373 } | 372 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 is_casting_ = started; | 678 is_casting_ = started; |
| 680 UpdatePrimaryView(); | 679 UpdatePrimaryView(); |
| 681 } | 680 } |
| 682 | 681 |
| 683 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { | 682 void TrayCast::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { |
| 684 if (tray_) | 683 if (tray_) |
| 685 tray_->UpdateAlignment(alignment); | 684 tray_->UpdateAlignment(alignment); |
| 686 } | 685 } |
| 687 | 686 |
| 688 } // namespace ash | 687 } // namespace ash |
| OLD | NEW |