| OLD | NEW |
| 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/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "content/public/browser/user_metrics.h" | 25 #include "content/public/browser/user_metrics.h" |
| 26 #include "content/public/common/service_manager_connection.h" | 26 #include "content/public/common/service_manager_connection.h" |
| 27 #include "net/base/escape.h" | 27 #include "net/base/escape.h" |
| 28 #include "services/shell/public/cpp/connector.h" | 28 #include "services/shell/public/cpp/connector.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 | 30 |
| 31 using chromeos::LoginState; | 31 using chromeos::LoginState; |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 const char kDisplaySettingsSubPageName[] = "display"; |
| 35 const char kPaletteSettingsSubPageName[] = "stylus-overlay"; | 36 const char kPaletteSettingsSubPageName[] = "stylus-overlay"; |
| 36 | 37 |
| 37 SystemTrayClient* g_instance = nullptr; | 38 SystemTrayClient* g_instance = nullptr; |
| 38 | 39 |
| 39 void ShowSettingsSubPageForActiveUser(const std::string& sub_page) { | 40 void ShowSettingsSubPageForActiveUser(const std::string& sub_page) { |
| 40 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), | 41 chrome::ShowSettingsSubPageForProfile(ProfileManager::GetActiveUserProfile(), |
| 41 sub_page); | 42 sub_page); |
| 42 } | 43 } |
| 43 | 44 |
| 44 } // namespace | 45 } // namespace |
| 45 | 46 |
| 46 // static | |
| 47 const char SystemTrayClient::kDisplaySettingsSubPageName[] = "display"; | |
| 48 const char SystemTrayClient::kDisplayOverscanSettingsSubPageName[] = | |
| 49 "displayOverscan"; | |
| 50 | |
| 51 SystemTrayClient::SystemTrayClient() { | 47 SystemTrayClient::SystemTrayClient() { |
| 52 // If this observes clock setting changes before ash comes up the IPCs will | 48 // If this observes clock setting changes before ash comes up the IPCs will |
| 53 // be queued on |system_tray_|. | 49 // be queued on |system_tray_|. |
| 54 g_browser_process->platform_part()->GetSystemClock()->AddObserver(this); | 50 g_browser_process->platform_part()->GetSystemClock()->AddObserver(this); |
| 55 | 51 |
| 56 DCHECK(!g_instance); | 52 DCHECK(!g_instance); |
| 57 g_instance = this; | 53 g_instance = this; |
| 58 } | 54 } |
| 59 | 55 |
| 60 SystemTrayClient::~SystemTrayClient() { | 56 SystemTrayClient::~SystemTrayClient() { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 connector->ConnectToInterface("service:content_browser", &system_tray_); | 188 connector->ConnectToInterface("service:content_browser", &system_tray_); |
| 193 | 189 |
| 194 // Tolerate ash crashing and coming back up. | 190 // Tolerate ash crashing and coming back up. |
| 195 system_tray_.set_connection_error_handler(base::Bind( | 191 system_tray_.set_connection_error_handler(base::Bind( |
| 196 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); | 192 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); |
| 197 } | 193 } |
| 198 | 194 |
| 199 void SystemTrayClient::OnClientConnectionError() { | 195 void SystemTrayClient::OnClientConnectionError() { |
| 200 system_tray_.reset(); | 196 system_tray_.reset(); |
| 201 } | 197 } |
| OLD | NEW |