Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/host/root_window_host_factory.h" | 8 #include "ash/host/root_window_host_factory.h" |
| 9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
| 10 #include "ash/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.h" |
| 11 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
| 12 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
| 13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 17 #include "base/utf_string_conversions.h" | |
| 17 #include "chrome/browser/app_mode/app_mode_utils.h" | 18 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 19 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 19 #include "chrome/browser/chromeos/login/screen_locker.h" | 20 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 20 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 21 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
| 21 #include "chrome/browser/lifetime/application_lifetime.h" | 22 #include "chrome/browser/lifetime/application_lifetime.h" |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
| 23 #include "chrome/browser/sessions/tab_restore_service.h" | 24 #include "chrome/browser/sessions/tab_restore_service.h" |
| 24 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 25 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 25 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | 26 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 26 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" | 27 #include "chrome/browser/ui/ash/app_list/app_list_controller_ash.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 43 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
| 44 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 45 #include "grit/chromium_strings.h" | 46 #include "grit/chromium_strings.h" |
| 46 #include "grit/generated_resources.h" | 47 #include "grit/generated_resources.h" |
| 47 #include "ui/aura/client/user_action_client.h" | 48 #include "ui/aura/client/user_action_client.h" |
| 48 #include "ui/aura/window.h" | 49 #include "ui/aura/window.h" |
| 49 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
| 50 | 51 |
| 51 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
| 52 #include "ash/keyboard_overlay/keyboard_overlay_view.h" | 53 #include "ash/keyboard_overlay/keyboard_overlay_view.h" |
| 54 #include "ash/system/tray/system_tray_notifier.h" | |
| 53 #include "base/chromeos/chromeos_version.h" | 55 #include "base/chromeos/chromeos_version.h" |
| 54 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 56 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 55 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" | 57 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
| 58 #include "chrome/browser/chromeos/cros/cros_library.h" | |
| 59 #include "chrome/browser/chromeos/cros/network_library.h" | |
| 56 #include "chrome/browser/chromeos/extensions/media_player_api.h" | 60 #include "chrome/browser/chromeos/extensions/media_player_api.h" |
| 57 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 61 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
| 58 #include "chrome/browser/chromeos/login/user_manager.h" | 62 #include "chrome/browser/chromeos/login/user_manager.h" |
| 59 #include "chrome/browser/chromeos/login/webui_login_display_host.h" | 63 #include "chrome/browser/chromeos/login/webui_login_display_host.h" |
| 60 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 64 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
| 61 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 65 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 62 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 66 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 63 #include "chromeos/dbus/dbus_thread_manager.h" | 67 #include "chromeos/dbus/dbus_thread_manager.h" |
| 64 #include "chromeos/dbus/power_manager_client.h" | 68 #include "chromeos/dbus/power_manager_client.h" |
| 65 #include "chromeos/dbus/session_manager_client.h" | 69 #include "chromeos/dbus/session_manager_client.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 content::PAGE_TRANSITION_GENERATED, | 249 content::PAGE_TRANSITION_GENERATED, |
| 246 false)); | 250 false)); |
| 247 browser->window()->Show(); | 251 browser->window()->Show(); |
| 248 browser->window()->Activate(); | 252 browser->window()->Activate(); |
| 249 page->Focus(); | 253 page->Focus(); |
| 250 #endif | 254 #endif |
| 251 } | 255 } |
| 252 | 256 |
| 253 void ChromeShellDelegate::OpenMobileSetup(const std::string& service_path) { | 257 void ChromeShellDelegate::OpenMobileSetup(const std::string& service_path) { |
| 254 #if defined(OS_CHROMEOS) | 258 #if defined(OS_CHROMEOS) |
| 259 chromeos::NetworkLibrary* cros = | |
| 260 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | |
| 261 const chromeos::CellularNetwork* cellular = cros->cellular_network(); | |
| 262 if (cellular && !cellular->activate_over_non_cellular_network() && | |
|
rkc
2013/02/14 23:32:12
so I'm reading this as,
1.) (cellular &&) if we ha
stevenjb
2013/02/14 23:43:17
Thank you, yes, I got the logic backward (test ima
| |
| 263 (!cros->connected_network() || !cros->connected_network()->online())) { | |
| 264 ash::Shell::GetInstance()->system_tray_notifier()->NotifySetNetworkMessage( | |
| 265 NULL, | |
| 266 ash::NetworkObserver::ERROR_CONNECT_FAILED, | |
| 267 ash::NetworkObserver::NETWORK_CELLULAR, | |
| 268 l10n_util::GetStringUTF16(IDS_NETWORK_ACTIVATION_ERROR_TITLE), | |
| 269 l10n_util::GetStringFUTF16(IDS_NETWORK_ACTIVATION_NEEDS_CONNECTION, | |
| 270 UTF8ToUTF16((cellular->name()))), | |
| 271 std::vector<string16>()); | |
| 272 return; | |
| 273 } | |
| 255 MobileSetupDialog::Show(service_path); | 274 MobileSetupDialog::Show(service_path); |
| 256 #endif | 275 #endif |
| 257 } | 276 } |
| 258 | 277 |
| 259 void ChromeShellDelegate::RestoreTab() { | 278 void ChromeShellDelegate::RestoreTab() { |
| 260 Browser* browser = GetTargetBrowser(); | 279 Browser* browser = GetTargetBrowser(); |
| 261 // Do not restore tabs while in the incognito mode. | 280 // Do not restore tabs while in the incognito mode. |
| 262 if (browser->profile()->IsOffTheRecord()) | 281 if (browser->profile()->IsOffTheRecord()) |
| 263 return; | 282 return; |
| 264 TabRestoreService* service = | 283 TabRestoreService* service = |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 ash::Shell::GetInstance()->ShowLauncher(); | 627 ash::Shell::GetInstance()->ShowLauncher(); |
| 609 break; | 628 break; |
| 610 default: | 629 default: |
| 611 NOTREACHED() << "Unexpected notification " << type; | 630 NOTREACHED() << "Unexpected notification " << type; |
| 612 } | 631 } |
| 613 #else | 632 #else |
| 614 // MSVC++ warns about switch statements without any cases. | 633 // MSVC++ warns about switch statements without any cases. |
| 615 NOTREACHED() << "Unexpected notification " << type; | 634 NOTREACHED() << "Unexpected notification " << type; |
| 616 #endif | 635 #endif |
| 617 } | 636 } |
| OLD | NEW |