| OLD | NEW |
| 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/common/system/chromeos/bluetooth/tray_bluetooth.h" | 5 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | |
| 10 #include "ash/common/system/tray/hover_highlight_view.h" | 9 #include "ash/common/system/tray/hover_highlight_view.h" |
| 11 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| 12 #include "ash/common/system/tray/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
| 13 #include "ash/common/system/tray/system_tray_notifier.h" | 12 #include "ash/common/system/tray/system_tray_notifier.h" |
| 14 #include "ash/common/system/tray/throbber_view.h" | 13 #include "ash/common/system/tray/throbber_view.h" |
| 15 #include "ash/common/system/tray/tray_constants.h" | 14 #include "ash/common/system/tray/tray_constants.h" |
| 16 #include "ash/common/system/tray/tray_details_view.h" | 15 #include "ash/common/system/tray/tray_details_view.h" |
| 17 #include "ash/common/system/tray/tray_item_more.h" | 16 #include "ash/common/system/tray/tray_item_more.h" |
| 18 #include "ash/common/system/tray/tray_popup_header_button.h" | 17 #include "ash/common/system/tray/tray_popup_header_button.h" |
| 19 #include "ash/common/system/tray/tray_popup_item_style.h" | 18 #include "ash/common/system/tray/tray_popup_item_style.h" |
| 20 #include "ash/common/system/tray/tray_popup_utils.h" | 19 #include "ash/common/system/tray/tray_popup_utils.h" |
| 21 #include "ash/common/system/tray/tri_view.h" | 20 #include "ash/common/system/tray/tri_view.h" |
| 22 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
| 23 #include "ash/resources/vector_icons/vector_icons.h" | 22 #include "ash/resources/vector_icons/vector_icons.h" |
| 24 #include "device/bluetooth/bluetooth_common.h" | 23 #include "device/bluetooth/bluetooth_common.h" |
| 25 #include "grit/ash_resources.h" | 24 #include "grit/ash_resources.h" |
| 26 #include "grit/ash_strings.h" | 25 #include "grit/ash_strings.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/gfx/color_palette.h" | 28 #include "ui/gfx/color_palette.h" |
| 30 #include "ui/gfx/image/image.h" | 29 #include "ui/gfx/image/image.h" |
| 31 #include "ui/gfx/paint_vector_icon.h" | 30 #include "ui/gfx/paint_vector_icon.h" |
| 32 #include "ui/gfx/vector_icons_public.h" | 31 #include "ui/gfx/vector_icons_public.h" |
| 33 #include "ui/views/controls/button/toggle_button.h" | 32 #include "ui/views/controls/button/toggle_button.h" |
| 34 #include "ui/views/controls/image_view.h" | 33 #include "ui/views/controls/image_view.h" |
| 35 #include "ui/views/controls/label.h" | 34 #include "ui/views/controls/label.h" |
| 36 #include "ui/views/controls/progress_bar.h" | 35 #include "ui/views/controls/progress_bar.h" |
| 36 #include "ui/views/controls/scroll_view.h" |
| 37 #include "ui/views/controls/separator.h" | 37 #include "ui/views/controls/separator.h" |
| 38 #include "ui/views/layout/box_layout.h" | 38 #include "ui/views/layout/box_layout.h" |
| 39 | 39 |
| 40 namespace ash { | 40 namespace ash { |
| 41 namespace tray { | 41 namespace tray { |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 bool UseMd() { | 44 bool UseMd() { |
| 45 return MaterialDesignController::IsSystemTrayMenuMaterial(); | 45 return MaterialDesignController::IsSystemTrayMenuMaterial(); |
| 46 } | 46 } |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); | 490 TrayPopupItemStyle::FontStyle::DETAILED_VIEW_LABEL); |
| 491 gfx::ImageSkia icon_image = CreateVectorIcon( | 491 gfx::ImageSkia icon_image = CreateVectorIcon( |
| 492 GetBluetoothDeviceIcon(device_type, false), style.GetIconColor()); | 492 GetBluetoothDeviceIcon(device_type, false), style.GetIconColor()); |
| 493 SetupConnectingItemMd(container, display_name, icon_image); | 493 SetupConnectingItemMd(container, display_name, icon_image); |
| 494 } else { | 494 } else { |
| 495 display_name = l10n_util::GetStringFUTF16( | 495 display_name = l10n_util::GetStringFUTF16( |
| 496 IDS_ASH_STATUS_TRAY_BLUETOOTH_CONNECTING, display_name); | 496 IDS_ASH_STATUS_TRAY_BLUETOOTH_CONNECTING, display_name); |
| 497 container->AddCheckableLabel(display_name, true /* highlight */, false); | 497 container->AddCheckableLabel(display_name, true /* highlight */, false); |
| 498 } | 498 } |
| 499 scroll_content()->SizeToPreferredSize(); | 499 scroll_content()->SizeToPreferredSize(); |
| 500 static_cast<views::View*>(scroller())->Layout(); | 500 scroller()->Layout(); |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 | 503 |
| 504 // TrayDetailsView: | 504 // TrayDetailsView: |
| 505 void HandleViewClicked(views::View* view) override { | 505 void HandleViewClicked(views::View* view) override { |
| 506 if (view == manage_devices_) { | 506 if (view == manage_devices_) { |
| 507 ShowSettings(); | 507 ShowSettings(); |
| 508 return; | 508 return; |
| 509 } | 509 } |
| 510 | 510 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 detailed_->Update(); | 761 detailed_->Update(); |
| 762 } | 762 } |
| 763 | 763 |
| 764 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 764 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
| 765 if (!detailed_) | 765 if (!detailed_) |
| 766 return; | 766 return; |
| 767 detailed_->Update(); | 767 detailed_->Update(); |
| 768 } | 768 } |
| 769 | 769 |
| 770 } // namespace ash | 770 } // namespace ash |
| OLD | NEW |