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

Side by Side Diff: ash/system/chromeos/screen_layout_observer.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/system/chromeos/screen_layout_observer.h" 5 #include "ash/system/chromeos/screen_layout_observer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ash/common/metrics/user_metrics_action.h" 11 #include "ash/common/metrics/user_metrics_action.h"
12 #include "ash/common/system/chromeos/devicetype_utils.h" 12 #include "ash/common/system/chromeos/devicetype_utils.h"
13 #include "ash/common/system/system_notifier.h" 13 #include "ash/common/system/system_notifier.h"
14 #include "ash/common/system/tray/fixed_sized_image_view.h" 14 #include "ash/common/system/tray/fixed_sized_image_view.h"
15 #include "ash/common/system/tray/system_tray_controller.h"
15 #include "ash/common/system/tray/system_tray_delegate.h" 16 #include "ash/common/system/tray/system_tray_delegate.h"
16 #include "ash/common/system/tray/tray_constants.h" 17 #include "ash/common/system/tray/tray_constants.h"
17 #include "ash/common/system/tray/tray_notification_view.h" 18 #include "ash/common/system/tray/tray_notification_view.h"
18 #include "ash/common/wm_shell.h" 19 #include "ash/common/wm_shell.h"
19 #include "ash/display/display_manager.h" 20 #include "ash/display/display_manager.h"
20 #include "ash/display/screen_orientation_controller_chromeos.h" 21 #include "ash/display/screen_orientation_controller_chromeos.h"
21 #include "ash/shell.h" 22 #include "ash/shell.h"
22 #include "base/bind.h" 23 #include "base/bind.h"
23 #include "base/strings/string_util.h" 24 #include "base/strings/string_util.h"
24 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return false; 73 return false;
73 74
74 case LoginStatus::USER: 75 case LoginStatus::USER:
75 case LoginStatus::OWNER: 76 case LoginStatus::OWNER:
76 case LoginStatus::GUEST: 77 case LoginStatus::GUEST:
77 case LoginStatus::PUBLIC: 78 case LoginStatus::PUBLIC:
78 case LoginStatus::SUPERVISED: 79 case LoginStatus::SUPERVISED:
79 case LoginStatus::KIOSK_APP: 80 case LoginStatus::KIOSK_APP:
80 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); 81 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
81 if (delegate->ShouldShowSettings()) { 82 if (delegate->ShouldShowSettings()) {
82 delegate->ShowDisplaySettings(); 83 WmShell::Get()->system_tray_controller()->ShowDisplaySettings();
83 return true; 84 return true;
84 } 85 }
85 } 86 }
86 87
87 return false; 88 return false;
88 } 89 }
89 90
90 // Callback to handle a user selecting the notification view. 91 // Callback to handle a user selecting the notification view.
91 void OpenSettingsFromNotification() { 92 void OpenSettingsFromNotification() {
92 WmShell::Get()->RecordUserMetricsAction( 93 WmShell::Get()->RecordUserMetricsAction(
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 return; 306 return;
306 } 307 }
307 308
308 base::string16 message; 309 base::string16 message;
309 base::string16 additional_message; 310 base::string16 additional_message;
310 if (GetDisplayMessageForNotification(old_info, &message, &additional_message)) 311 if (GetDisplayMessageForNotification(old_info, &message, &additional_message))
311 CreateOrUpdateNotification(message, additional_message); 312 CreateOrUpdateNotification(message, additional_message);
312 } 313 }
313 314
314 } // namespace ash 315 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698