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

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

Issue 12260046: Show notification when activating with no connection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix logic and type icon Created 7 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 =
262 cros->FindCellularNetworkByPath(service_path);
263 if (cellular && cellular->activate_over_non_cellular_network() &&
264 (!cros->connected_network() || !cros->connected_network()->online())) {
265 chromeos::NetworkTechnology technology = cellular->network_technology();
266 ash::NetworkObserver::NetworkType network_type =
267 (technology == chromeos::NETWORK_TECHNOLOGY_LTE ||
268 technology == chromeos::NETWORK_TECHNOLOGY_LTE_ADVANCED)
269 ? ash::NetworkObserver::NETWORK_CELLULAR_LTE
270 : ash::NetworkObserver::NETWORK_CELLULAR;
271 ash::Shell::GetInstance()->system_tray_notifier()->NotifySetNetworkMessage(
272 NULL,
273 ash::NetworkObserver::ERROR_CONNECT_FAILED,
274 network_type,
275 l10n_util::GetStringUTF16(IDS_NETWORK_ACTIVATION_ERROR_TITLE),
276 l10n_util::GetStringFUTF16(IDS_NETWORK_ACTIVATION_NEEDS_CONNECTION,
277 UTF8ToUTF16((cellular->name()))),
278 std::vector<string16>());
279 return;
280 }
255 MobileSetupDialog::Show(service_path); 281 MobileSetupDialog::Show(service_path);
256 #endif 282 #endif
257 } 283 }
258 284
259 void ChromeShellDelegate::RestoreTab() { 285 void ChromeShellDelegate::RestoreTab() {
260 Browser* browser = GetTargetBrowser(); 286 Browser* browser = GetTargetBrowser();
261 // Do not restore tabs while in the incognito mode. 287 // Do not restore tabs while in the incognito mode.
262 if (browser->profile()->IsOffTheRecord()) 288 if (browser->profile()->IsOffTheRecord())
263 return; 289 return;
264 TabRestoreService* service = 290 TabRestoreService* service =
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 ash::Shell::GetInstance()->ShowLauncher(); 634 ash::Shell::GetInstance()->ShowLauncher();
609 break; 635 break;
610 default: 636 default:
611 NOTREACHED() << "Unexpected notification " << type; 637 NOTREACHED() << "Unexpected notification " << type;
612 } 638 }
613 #else 639 #else
614 // MSVC++ warns about switch statements without any cases. 640 // MSVC++ warns about switch statements without any cases.
615 NOTREACHED() << "Unexpected notification " << type; 641 NOTREACHED() << "Unexpected notification " << type;
616 #endif 642 #endif
617 } 643 }
OLDNEW
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698