| 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/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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/ui/ash/ash_util.h" | 25 #include "chrome/browser/ui/ash/ash_util.h" |
| 26 #include "chrome/browser/ui/chrome_pages.h" | 26 #include "chrome/browser/ui/chrome_pages.h" |
| 27 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 27 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 28 #include "chrome/browser/ui/singleton_tabs.h" | 28 #include "chrome/browser/ui/singleton_tabs.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
| 31 #include "chromeos/dbus/session_manager_client.h" | 31 #include "chromeos/dbus/session_manager_client.h" |
| 32 #include "chromeos/login/login_state.h" | 32 #include "chromeos/login/login_state.h" |
| 33 #include "content/public/browser/user_metrics.h" | 33 #include "content/public/browser/user_metrics.h" |
| 34 #include "content/public/common/service_manager_connection.h" | 34 #include "content/public/common/service_manager_connection.h" |
| 35 #include "content/public/common/service_names.mojom.h" |
| 35 #include "net/base/escape.h" | 36 #include "net/base/escape.h" |
| 36 #include "services/service_manager/public/cpp/connector.h" | 37 #include "services/service_manager/public/cpp/connector.h" |
| 37 #include "services/ui/public/cpp/property_type_converters.h" | 38 #include "services/ui/public/cpp/property_type_converters.h" |
| 38 #include "services/ui/public/interfaces/window_manager.mojom.h" | 39 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 39 #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" | 40 #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" |
| 40 #include "ui/views/widget/widget.h" | 41 #include "ui/views/widget/widget.h" |
| 41 #include "ui/views/window/dialog_delegate.h" | 42 #include "ui/views/window/dialog_delegate.h" |
| 42 | 43 |
| 43 using chromeos::DBusThreadManager; | 44 using chromeos::DBusThreadManager; |
| 44 using chromeos::LoginState; | 45 using chromeos::LoginState; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 298 } |
| 298 | 299 |
| 299 void SystemTrayClient::ConnectToSystemTray() { | 300 void SystemTrayClient::ConnectToSystemTray() { |
| 300 if (system_tray_.is_bound()) | 301 if (system_tray_.is_bound()) |
| 301 return; | 302 return; |
| 302 | 303 |
| 303 service_manager::Connector* connector = | 304 service_manager::Connector* connector = |
| 304 content::ServiceManagerConnection::GetForProcess()->GetConnector(); | 305 content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
| 305 // Under mash the SystemTray interface is in the ash process. In classic ash | 306 // Under mash the SystemTray interface is in the ash process. In classic ash |
| 306 // we provide it to ourself. | 307 // we provide it to ourself. |
| 307 if (chrome::IsRunningInMash()) | 308 if (chrome::IsRunningInMash()) { |
| 308 connector->ConnectToInterface("ash", &system_tray_); | 309 connector->ConnectToInterface("ash", &system_tray_); |
| 309 else | 310 } else { |
| 310 connector->ConnectToInterface("content_browser", &system_tray_); | 311 connector->ConnectToInterface(content::mojom::kBrowserServiceName, |
| 312 &system_tray_); |
| 313 } |
| 311 | 314 |
| 312 // Tolerate ash crashing and coming back up. | 315 // Tolerate ash crashing and coming back up. |
| 313 system_tray_.set_connection_error_handler(base::Bind( | 316 system_tray_.set_connection_error_handler(base::Bind( |
| 314 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); | 317 &SystemTrayClient::OnClientConnectionError, base::Unretained(this))); |
| 315 } | 318 } |
| 316 | 319 |
| 317 void SystemTrayClient::OnClientConnectionError() { | 320 void SystemTrayClient::OnClientConnectionError() { |
| 318 system_tray_.reset(); | 321 system_tray_.reset(); |
| 319 } | 322 } |
| OLD | NEW |