| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include "ash/keyboard_overlay/keyboard_overlay_view.h" | 7 #include "ash/keyboard_overlay/keyboard_overlay_view.h" |
| 8 #include "ash/system/chromeos/network/network_observer.h" | 8 #include "ash/system/chromeos/network/network_observer.h" |
| 9 #include "ash/system/tray/system_tray_notifier.h" | 9 #include "ash/system/tray/system_tray_notifier.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 37 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 38 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 38 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 39 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 42 #include "chromeos/dbus/dbus_thread_manager.h" | 42 #include "chromeos/dbus/dbus_thread_manager.h" |
| 43 #include "chromeos/dbus/power_manager_client.h" | 43 #include "chromeos/dbus/power_manager_client.h" |
| 44 #include "chromeos/dbus/session_manager_client.h" | 44 #include "chromeos/dbus/session_manager_client.h" |
| 45 #include "content/public/browser/user_metrics.h" | 45 #include "content/public/browser/user_metrics.h" |
| 46 #include "content/public/browser/web_contents.h" | 46 #include "content/public/browser/web_contents.h" |
| 47 #include "content/public/browser/web_contents_view.h" |
| 47 #include "grit/generated_resources.h" | 48 #include "grit/generated_resources.h" |
| 48 #include "ui/base/l10n/l10n_util.h" | 49 #include "ui/base/l10n/l10n_util.h" |
| 49 | 50 |
| 50 bool ChromeShellDelegate::IsUserLoggedIn() const { | 51 bool ChromeShellDelegate::IsUserLoggedIn() const { |
| 51 // When running a Chrome OS build outside of a device (i.e. on a developer's | 52 // When running a Chrome OS build outside of a device (i.e. on a developer's |
| 52 // workstation) and not running as login-manager, pretend like we're always | 53 // workstation) and not running as login-manager, pretend like we're always |
| 53 // logged in. | 54 // logged in. |
| 54 if (!base::chromeos::IsRunningOnChromeOS() && | 55 if (!base::chromeos::IsRunningOnChromeOS() && |
| 55 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) { | 56 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) { |
| 56 return true; | 57 return true; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return; | 116 return; |
| 116 Browser* browser = GetTargetBrowser(); | 117 Browser* browser = GetTargetBrowser(); |
| 117 content::WebContents* page = browser->OpenURL( | 118 content::WebContents* page = browser->OpenURL( |
| 118 content::OpenURLParams(crosh_url, | 119 content::OpenURLParams(crosh_url, |
| 119 content::Referrer(), | 120 content::Referrer(), |
| 120 NEW_FOREGROUND_TAB, | 121 NEW_FOREGROUND_TAB, |
| 121 content::PAGE_TRANSITION_GENERATED, | 122 content::PAGE_TRANSITION_GENERATED, |
| 122 false)); | 123 false)); |
| 123 browser->window()->Show(); | 124 browser->window()->Show(); |
| 124 browser->window()->Activate(); | 125 browser->window()->Activate(); |
| 125 page->Focus(); | 126 page->GetView()->Focus(); |
| 126 } | 127 } |
| 127 | 128 |
| 128 void ChromeShellDelegate::OpenMobileSetup(const std::string& service_path) { | 129 void ChromeShellDelegate::OpenMobileSetup(const std::string& service_path) { |
| 129 chromeos::NetworkLibrary* cros = | 130 chromeos::NetworkLibrary* cros = |
| 130 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 131 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
| 131 const chromeos::CellularNetwork* cellular = | 132 const chromeos::CellularNetwork* cellular = |
| 132 cros->FindCellularNetworkByPath(service_path); | 133 cros->FindCellularNetworkByPath(service_path); |
| 133 if (cellular && cellular->activate_over_non_cellular_network() && | 134 if (cellular && cellular->activate_over_non_cellular_network() && |
| 134 (!cros->connected_network() || !cros->connected_network()->online())) { | 135 (!cros->connected_network() || !cros->connected_network()->online())) { |
| 135 chromeos::NetworkTechnology technology = cellular->network_technology(); | 136 chromeos::NetworkTechnology technology = cellular->network_technology(); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 287 } |
| 287 | 288 |
| 288 void ChromeShellDelegate::PlatformInit() { | 289 void ChromeShellDelegate::PlatformInit() { |
| 289 registrar_.Add(this, | 290 registrar_.Add(this, |
| 290 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 291 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 291 content::NotificationService::AllSources()); | 292 content::NotificationService::AllSources()); |
| 292 registrar_.Add(this, | 293 registrar_.Add(this, |
| 293 chrome::NOTIFICATION_SESSION_STARTED, | 294 chrome::NOTIFICATION_SESSION_STARTED, |
| 294 content::NotificationService::AllSources()); | 295 content::NotificationService::AllSources()); |
| 295 } | 296 } |
| OLD | NEW |