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

Side by Side Diff: ash/common/system/date/date_default_view.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/date/date_default_view.h" 5 #include "ash/common/system/date/date_default_view.h"
6 6
7 #include "ash/common/metrics/user_metrics_action.h" 7 #include "ash/common/metrics/user_metrics_action.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/system/date/date_view.h" 9 #include "ash/common/system/date/date_view.h"
10 #include "ash/common/system/tray/special_popup_row.h" 10 #include "ash/common/system/tray/special_popup_row.h"
11 #include "ash/common/system/tray/system_tray_delegate.h" 11 #include "ash/common/system/tray/system_tray_delegate.h"
12 #include "ash/common/system/tray/tray_constants.h" 12 #include "ash/common/system/tray/tray_constants.h"
13 #include "ash/common/system/tray/tray_popup_header_button.h" 13 #include "ash/common/system/tray/tray_popup_header_button.h"
14 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
15 #include "base/i18n/rtl.h" 15 #include "base/i18n/rtl.h"
16 #include "grit/ash_resources.h" 16 #include "grit/ash_resources.h"
17 #include "grit/ash_strings.h" 17 #include "grit/ash_strings.h"
18 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/views/border.h" 19 #include "ui/views/border.h"
20 #include "ui/views/controls/button/button.h" 20 #include "ui/views/controls/button/button.h"
21 #include "ui/views/layout/fill_layout.h" 21 #include "ui/views/layout/fill_layout.h"
22 #include "ui/views/view.h" 22 #include "ui/views/view.h"
23 23
24 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
25 #include "chromeos/dbus/dbus_thread_manager.h" 25 #include "ash/common/dbus_thread_manager_ash.h"
26 // #include "chromeos/dbus/dbus_thread_manager.h"
26 #include "chromeos/dbus/session_manager_client.h" 27 #include "chromeos/dbus/session_manager_client.h"
27 #endif 28 #endif
28 29
29 namespace { 30 namespace {
30 31
31 // The ISO-639 code for the Hebrew locale. The help icon asset is a '?' which is 32 // The ISO-639 code for the Hebrew locale. The help icon asset is a '?' which is
32 // not mirrored in this locale. 33 // not mirrored in this locale.
33 const char kHebrewLocale[] = "he"; 34 const char kHebrewLocale[] = "he";
34 35
35 const int kPaddingVertical = 19; 36 const int kPaddingVertical = 19;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 SystemTrayDelegate* tray_delegate = shell->system_tray_delegate(); 136 SystemTrayDelegate* tray_delegate = shell->system_tray_delegate();
136 if (sender == help_button_) { 137 if (sender == help_button_) {
137 shell->RecordUserMetricsAction(UMA_TRAY_HELP); 138 shell->RecordUserMetricsAction(UMA_TRAY_HELP);
138 tray_delegate->ShowHelp(); 139 tray_delegate->ShowHelp();
139 } else if (sender == shutdown_button_) { 140 } else if (sender == shutdown_button_) {
140 shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN); 141 shell->RecordUserMetricsAction(UMA_TRAY_SHUT_DOWN);
141 tray_delegate->RequestShutdown(); 142 tray_delegate->RequestShutdown();
142 } else if (sender == lock_button_) { 143 } else if (sender == lock_button_) {
143 shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN); 144 shell->RecordUserMetricsAction(UMA_TRAY_LOCK_SCREEN);
144 #if defined(OS_CHROMEOS) 145 #if defined(OS_CHROMEOS)
145 chromeos::DBusThreadManager::Get() 146 DBusThreadManagerAsh::Get()
146 ->GetSessionManagerClient() 147 ->GetSessionManagerClient()
147 ->RequestLockScreen(); 148 ->RequestLockScreen();
148 #endif 149 #endif
149 } else { 150 } else {
150 NOTREACHED(); 151 NOTREACHED();
151 } 152 }
152 } 153 }
153 154
154 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { 155 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
155 if (!shutdown_button_) 156 if (!shutdown_button_)
156 return; 157 return;
157 158
158 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( 159 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16(
159 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT 160 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT
160 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); 161 : IDS_ASH_STATUS_TRAY_SHUTDOWN));
161 } 162 }
162 163
163 } // namespace ash 164 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/system_clock_observer.cc ('k') | ash/common/wm/maximize_mode/maximize_mode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698