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

Side by Side Diff: chrome/browser/ui/ash/system_tray_client.cc

Issue 2438023004: mash: Migrate ShowSetTimeDialog from SystemTrayDelegate to mojo (Closed)
Patch Set: rebase 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/ash/system_tray_client.h" 5 #include "chrome/browser/ui/ash/system_tray_client.h"
6 6
7 #include "ash/common/login_status.h" 7 #include "ash/common/login_status.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browser_process_platform_part.h" 15 #include "chrome/browser/browser_process_platform_part.h"
16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
17 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 17 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
18 #include "chrome/browser/chromeos/options/network_config_view.h" 18 #include "chrome/browser/chromeos/options/network_config_view.h"
19 #include "chrome/browser/chromeos/set_time_dialog.h"
19 #include "chrome/browser/chromeos/system/system_clock.h" 20 #include "chrome/browser/chromeos/system/system_clock.h"
20 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
21 #include "chrome/browser/ui/ash/ash_util.h" 22 #include "chrome/browser/ui/ash/ash_util.h"
22 #include "chrome/browser/ui/chrome_pages.h" 23 #include "chrome/browser/ui/chrome_pages.h"
23 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
24 #include "chrome/browser/ui/singleton_tabs.h" 25 #include "chrome/browser/ui/singleton_tabs.h"
25 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
26 #include "chrome/grit/generated_resources.h" 27 #include "chrome/grit/generated_resources.h"
27 #include "chromeos/dbus/dbus_thread_manager.h" 28 #include "chromeos/dbus/dbus_thread_manager.h"
28 #include "chromeos/dbus/session_manager_client.h" 29 #include "chromeos/dbus/session_manager_client.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 void SystemTrayClient::ShowDateSettings() { 137 void SystemTrayClient::ShowDateSettings() {
137 content::RecordAction(base::UserMetricsAction("ShowDateOptions")); 138 content::RecordAction(base::UserMetricsAction("ShowDateOptions"));
138 std::string sub_page = 139 std::string sub_page =
139 std::string(chrome::kSearchSubPage) + "#" + 140 std::string(chrome::kSearchSubPage) + "#" +
140 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); 141 l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME);
141 // Everybody can change the time zone (even though it is a device setting). 142 // Everybody can change the time zone (even though it is a device setting).
142 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), 143 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(),
143 sub_page); 144 sub_page);
144 } 145 }
145 146
147 void SystemTrayClient::ShowSetTimeDialog() {
148 chromeos::SetTimeDialog::ShowDialogInContainer(GetDialogParentContainerId());
149 }
150
146 void SystemTrayClient::ShowDisplaySettings() { 151 void SystemTrayClient::ShowDisplaySettings() {
147 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); 152 content::RecordAction(base::UserMetricsAction("ShowDisplayOptions"));
148 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName); 153 ShowSettingsSubPageForActiveUser(kDisplaySettingsSubPageName);
149 } 154 }
150 155
151 void SystemTrayClient::ShowPowerSettings() { 156 void SystemTrayClient::ShowPowerSettings() {
152 content::RecordAction(base::UserMetricsAction("Tray_ShowPowerOptions")); 157 content::RecordAction(base::UserMetricsAction("Tray_ShowPowerOptions"));
153 ShowSettingsSubPageForActiveUser(chrome::kPowerOptionsSubPage); 158 ShowSettingsSubPageForActiveUser(chrome::kPowerOptionsSubPage);
154 } 159 }
155 160
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 connector->ConnectToInterface("service:content_browser", &system_tray_); 267 connector->ConnectToInterface("service:content_browser", &system_tray_);
263 268
264 // Tolerate ash crashing and coming back up. 269 // Tolerate ash crashing and coming back up.
265 system_tray_.set_connection_error_handler(base::Bind( 270 system_tray_.set_connection_error_handler(base::Bind(
266 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); 271 &SystemTrayClient::OnClientConnectionError, base::Unretained(this)));
267 } 272 }
268 273
269 void SystemTrayClient::OnClientConnectionError() { 274 void SystemTrayClient::OnClientConnectionError() {
270 system_tray_.reset(); 275 system_tray_.reset();
271 } 276 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_client.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698