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

Side by Side Diff: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc

Issue 2497813002: Modify Ash MD system menu layout for title rows (Closed)
Patch Set: Ben comments 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
OLDNEW
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" 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h"
10 #include "ash/common/system/tray/hover_highlight_view.h" 10 #include "ash/common/system/tray/hover_highlight_view.h"
11 #include "ash/common/system/tray/system_tray.h" 11 #include "ash/common/system/tray/system_tray.h"
12 #include "ash/common/system/tray/system_tray_delegate.h" 12 #include "ash/common/system/tray/system_tray_delegate.h"
13 #include "ash/common/system/tray/system_tray_notifier.h" 13 #include "ash/common/system/tray/system_tray_notifier.h"
14 #include "ash/common/system/tray/throbber_view.h" 14 #include "ash/common/system/tray/throbber_view.h"
15 #include "ash/common/system/tray/tray_constants.h" 15 #include "ash/common/system/tray/tray_constants.h"
16 #include "ash/common/system/tray/tray_details_view.h" 16 #include "ash/common/system/tray/tray_details_view.h"
17 #include "ash/common/system/tray/tray_item_more.h" 17 #include "ash/common/system/tray/tray_item_more.h"
18 #include "ash/common/system/tray/tray_popup_header_button.h" 18 #include "ash/common/system/tray/tray_popup_header_button.h"
19 #include "ash/common/system/tray/tray_popup_item_style.h" 19 #include "ash/common/system/tray/tray_popup_item_style.h"
20 #include "ash/common/system/tray/tray_popup_utils.h" 20 #include "ash/common/system/tray/tray_popup_utils.h"
21 #include "ash/common/system/tray/tri_view.h"
21 #include "ash/common/wm_shell.h" 22 #include "ash/common/wm_shell.h"
22 #include "ash/resources/vector_icons/vector_icons.h" 23 #include "ash/resources/vector_icons/vector_icons.h"
23 #include "device/bluetooth/bluetooth_common.h" 24 #include "device/bluetooth/bluetooth_common.h"
24 #include "grit/ash_resources.h" 25 #include "grit/ash_resources.h"
25 #include "grit/ash_strings.h" 26 #include "grit/ash_strings.h"
26 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
27 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
28 #include "ui/gfx/color_palette.h" 29 #include "ui/gfx/color_palette.h"
29 #include "ui/gfx/image/image.h" 30 #include "ui/gfx/image/image.h"
30 #include "ui/gfx/paint_vector_icon.h" 31 #include "ui/gfx/paint_vector_icon.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 delegate->ToggleBluetooth(); 490 delegate->ToggleBluetooth();
490 else 491 else
491 NOTREACHED(); 492 NOTREACHED();
492 } 493 }
493 494
494 void CreateExtraTitleRowButtons() override { 495 void CreateExtraTitleRowButtons() override {
495 if (login_ == LoginStatus::LOCKED) 496 if (login_ == LoginStatus::LOCKED)
496 return; 497 return;
497 498
498 if (UseMd()) { 499 if (UseMd()) {
499 toggle_ = title_row()->AddToggleButton(this); 500 DCHECK(!toggle_);
500 settings_ = title_row()->AddSettingsButton(this, login_); 501 DCHECK(!settings_);
502
503 tri_view()->SetContainerVisible(TriView::Container::END, true);
504
505 // TODO(tdanderson): Move common toggle-creation logic to TrayPopupUtils.
506 // See crbug.com/614453.
507 toggle_ = new views::ToggleButton(this);
508 toggle_->SetFocusForPlatform();
509 toggle_->SetAccessibleName(
510 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
511 IDS_ASH_STATUS_TRAY_BLUETOOTH));
512 tri_view()->AddView(TriView::Container::END, toggle_);
513
514 settings_ = CreateSettingsButton(login_);
515 tri_view()->AddView(TriView::Container::END, settings_);
501 return; 516 return;
502 } 517 }
503 518
504 throbber_ = new ThrobberView; 519 throbber_ = new ThrobberView;
505 throbber_->SetTooltipText( 520 throbber_->SetTooltipText(
506 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING)); 521 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING));
507 title_row()->AddViewToRowNonMd(throbber_, false); 522 title_row()->AddViewToRowNonMd(throbber_, false);
508 523
509 // Do not allow toggling bluetooth in the lock screen. 524 // Do not allow toggling bluetooth in the lock screen.
510 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); 525 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 detailed_->Update(); 706 detailed_->Update();
692 } 707 }
693 708
694 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 709 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
695 if (!detailed_) 710 if (!detailed_)
696 return; 711 return;
697 detailed_->Update(); 712 detailed_->Update();
698 } 713 }
699 714
700 } // namespace ash 715 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/chromeos/ime_menu/ime_list_view.cc » ('j') | ash/common/system/tray/tray_details_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698