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

Side by Side Diff: ash/common/system/chromeos/settings/tray_settings.cc

Issue 2395523002: chromeos: Refactor system tray "show settings" commands to use mojo (Closed)
Patch Set: Created 4 years, 2 months 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/settings/tray_settings.h" 5 #include "ash/common/system/chromeos/settings/tray_settings.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/chromeos/power/power_status.h" 9 #include "ash/common/system/chromeos/power/power_status.h"
10 #include "ash/common/system/chromeos/power/power_status_view.h" 10 #include "ash/common/system/chromeos/power/power_status_view.h"
11 #include "ash/common/system/tray/actionable_view.h" 11 #include "ash/common/system/tray/actionable_view.h"
12 #include "ash/common/system/tray/fixed_sized_image_view.h" 12 #include "ash/common/system/tray/fixed_sized_image_view.h"
13 #include "ash/common/system/tray/system_tray_controller.h"
13 #include "ash/common/system/tray/system_tray_delegate.h" 14 #include "ash/common/system/tray/system_tray_delegate.h"
14 #include "ash/common/system/tray/tray_constants.h" 15 #include "ash/common/system/tray/tray_constants.h"
15 #include "ash/common/wm_shell.h" 16 #include "ash/common/wm_shell.h"
16 #include "ash/resources/vector_icons/vector_icons.h" 17 #include "ash/resources/vector_icons/vector_icons.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
19 #include "grit/ash_resources.h" 20 #include "grit/ash_resources.h"
20 #include "grit/ash_strings.h" 21 #include "grit/ash_strings.h"
21 #include "third_party/skia/include/core/SkColor.h" 22 #include "third_party/skia/include/core/SkColor.h"
22 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ~SettingsDefaultView() override { PowerStatus::Get()->RemoveObserver(this); } 82 ~SettingsDefaultView() override { PowerStatus::Get()->RemoveObserver(this); }
82 83
83 // Overridden from ash::ActionableView. 84 // Overridden from ash::ActionableView.
84 bool PerformAction(const ui::Event& event) override { 85 bool PerformAction(const ui::Event& event) override {
85 if (login_status_ == LoginStatus::NOT_LOGGED_IN || 86 if (login_status_ == LoginStatus::NOT_LOGGED_IN ||
86 login_status_ == LoginStatus::LOCKED || 87 login_status_ == LoginStatus::LOCKED ||
87 WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) { 88 WmShell::Get()->GetSessionStateDelegate()->IsInSecondaryLoginScreen()) {
88 return false; 89 return false;
89 } 90 }
90 91
91 WmShell::Get()->system_tray_delegate()->ShowSettings(); 92 WmShell::Get()->system_tray_controller()->ShowSettings();
92 CloseSystemBubble(); 93 CloseSystemBubble();
93 return true; 94 return true;
94 } 95 }
95 96
96 // Overridden from views::View. 97 // Overridden from views::View.
97 void Layout() override { 98 void Layout() override {
98 views::View::Layout(); 99 views::View::Layout();
99 100
100 if (label_ && power_status_view_) { 101 if (label_ && power_status_view_) {
101 // Let the box-layout do the layout first. Then move power_status_view_ 102 // Let the box-layout do the layout first. Then move power_status_view_
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 167
167 void TraySettings::DestroyDefaultView() { 168 void TraySettings::DestroyDefaultView() {
168 default_view_ = nullptr; 169 default_view_ = nullptr;
169 } 170 }
170 171
171 void TraySettings::DestroyDetailedView() {} 172 void TraySettings::DestroyDetailedView() {}
172 173
173 void TraySettings::UpdateAfterLoginStatusChange(LoginStatus status) {} 174 void TraySettings::UpdateAfterLoginStatusChange(LoginStatus status) {}
174 175
175 } // namespace ash 176 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698