| 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/shelf/shelf_util.h" | 9 #include "ash/shelf/shelf_util.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/system/chromeos/screen_security/screen_tray_item.h" | 11 #include "ash/system/chromeos/screen_security/screen_tray_item.h" |
| 12 #include "ash/system/tray/fixed_sized_image_view.h" | 12 #include "ash/system/tray/fixed_sized_image_view.h" |
| 13 #include "ash/system/tray/fixed_sized_scroll_view.h" | 13 #include "ash/system/tray/fixed_sized_scroll_view.h" |
| 14 #include "ash/system/tray/hover_highlight_view.h" | 14 #include "ash/system/tray/hover_highlight_view.h" |
| 15 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
| 16 #include "ash/system/tray/system_tray_delegate.h" | 16 #include "ash/system/tray/system_tray_delegate.h" |
| 17 #include "ash/system/tray/system_tray_notifier.h" | 17 #include "ash/system/tray/system_tray_notifier.h" |
| 18 #include "ash/system/tray/throbber_view.h" | 18 #include "ash/system/tray/throbber_view.h" |
| 19 #include "ash/system/tray/tray_constants.h" | 19 #include "ash/system/tray/tray_constants.h" |
| 20 #include "ash/system/tray/tray_details_view.h" | 20 #include "ash/system/tray/tray_details_view.h" |
| 21 #include "ash/system/tray/tray_item_more.h" | 21 #include "ash/system/tray/tray_item_more.h" |
| 22 #include "ash/system/tray/tray_item_view.h" | 22 #include "ash/system/tray/tray_item_view.h" |
| 23 #include "ash/system/tray/tray_popup_label_button.h" | 23 #include "ash/system/tray/tray_popup_label_button.h" |
| 24 #include "ash/wm/common/shelf/wm_shelf_util.h" |
| 24 #include "base/bind.h" | 25 #include "base/bind.h" |
| 25 #include "grit/ash_resources.h" | 26 #include "grit/ash_resources.h" |
| 26 #include "grit/ash_strings.h" | 27 #include "grit/ash_strings.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/gfx/image/image.h" | 30 #include "ui/gfx/image/image.h" |
| 30 #include "ui/gfx/text_elider.h" | 31 #include "ui/gfx/text_elider.h" |
| 31 #include "ui/views/controls/button/button.h" | 32 #include "ui/views/controls/button/button.h" |
| 32 #include "ui/views/controls/image_view.h" | 33 #include "ui/views/controls/image_view.h" |
| 33 #include "ui/views/controls/label.h" | 34 #include "ui/views/controls/label.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() | 352 image_view()->SetImage(ui::ResourceBundle::GetSharedInstance() |
| 352 .GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE) | 353 .GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE) |
| 353 .ToImageSkia()); | 354 .ToImageSkia()); |
| 354 } | 355 } |
| 355 | 356 |
| 356 CastTrayView::~CastTrayView() { | 357 CastTrayView::~CastTrayView() { |
| 357 } | 358 } |
| 358 | 359 |
| 359 void CastTrayView::UpdateAlignment(wm::ShelfAlignment alignment) { | 360 void CastTrayView::UpdateAlignment(wm::ShelfAlignment alignment) { |
| 360 // Center the item dependent on the orientation of the shelf. | 361 // Center the item dependent on the orientation of the shelf. |
| 361 views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment) | 362 views::BoxLayout::Orientation layout = wm::IsHorizontalAlignment(alignment) |
| 362 ? views::BoxLayout::kVertical | 363 ? views::BoxLayout::kVertical |
| 363 : views::BoxLayout::kHorizontal; | 364 : views::BoxLayout::kHorizontal; |
| 364 SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); | 365 SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0)); |
| 365 Layout(); | 366 Layout(); |
| 366 } | 367 } |
| 367 | 368 |
| 368 // This view displays a list of cast receivers that can be clicked on and casted | 369 // This view displays a list of cast receivers that can be clicked on and casted |
| 369 // to. It is activated by clicking on the chevron inside of | 370 // to. It is activated by clicking on the chevron inside of |
| 370 // |CastSelectDefaultView|. | 371 // |CastSelectDefaultView|. |
| 371 class CastDetailedView : public TrayDetailsView, public ViewClickListener { | 372 class CastDetailedView : public TrayDetailsView, public ViewClickListener { |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 is_casting_ = started; | 673 is_casting_ = started; |
| 673 UpdatePrimaryView(); | 674 UpdatePrimaryView(); |
| 674 } | 675 } |
| 675 | 676 |
| 676 void TrayCast::UpdateAfterShelfAlignmentChange(wm::ShelfAlignment alignment) { | 677 void TrayCast::UpdateAfterShelfAlignmentChange(wm::ShelfAlignment alignment) { |
| 677 if (tray_) | 678 if (tray_) |
| 678 tray_->UpdateAlignment(alignment); | 679 tray_->UpdateAlignment(alignment); |
| 679 } | 680 } |
| 680 | 681 |
| 681 } // namespace ash | 682 } // namespace ash |
| OLD | NEW |