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

Side by Side Diff: ash/system/chromeos/network/network_state_notifier.cc

Issue 12843019: Suppress error notifications and detailed view during OOBE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TrayAccessibilityTest Created 7 years, 9 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 | « ash/ash_chromeos_strings.grdp ('k') | ash/system/chromeos/network/tray_network.cc » ('j') | 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 "ash/system/chromeos/network/network_state_notifier.h" 5 #include "ash/system/chromeos/network/network_state_notifier.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/chromeos/network/network_observer.h" 9 #include "ash/system/chromeos/network/network_observer.h"
10 #include "ash/system/tray/system_tray_notifier.h" 10 #include "ash/system/tray/system_tray_notifier.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "base/string_util.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "chromeos/network/network_event_log.h" 15 #include "chromeos/network/network_event_log.h"
15 #include "chromeos/network/network_state.h" 16 #include "chromeos/network/network_state.h"
16 #include "chromeos/network/network_state_handler.h" 17 #include "chromeos/network/network_state_handler.h"
17 #include "grit/ash_strings.h" 18 #include "grit/ash_strings.h"
18 #include "third_party/cros_system_api/dbus/service_constants.h" 19 #include "third_party/cros_system_api/dbus/service_constants.h"
19 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
20 21
21 using chromeos::NetworkState; 22 using chromeos::NetworkState;
22 using chromeos::NetworkStateHandler; 23 using chromeos::NetworkStateHandler;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 IDS_CHROMEOS_NETWORK_ERROR_IPSEC_PSK_AUTH_FAILED); 89 IDS_CHROMEOS_NETWORK_ERROR_IPSEC_PSK_AUTH_FAILED);
89 } 90 }
90 if (error == flimflam::kErrorIpsecCertAuthFailed) { 91 if (error == flimflam::kErrorIpsecCertAuthFailed) {
91 return l10n_util::GetStringUTF16( 92 return l10n_util::GetStringUTF16(
92 IDS_CHROMEOS_NETWORK_ERROR_IPSEC_CERT_AUTH_FAILED); 93 IDS_CHROMEOS_NETWORK_ERROR_IPSEC_CERT_AUTH_FAILED);
93 } 94 }
94 if (error == flimflam::kErrorPppAuthFailed) { 95 if (error == flimflam::kErrorPppAuthFailed) {
95 return l10n_util::GetStringUTF16( 96 return l10n_util::GetStringUTF16(
96 IDS_CHROMEOS_NETWORK_ERROR_PPP_AUTH_FAILED); 97 IDS_CHROMEOS_NETWORK_ERROR_PPP_AUTH_FAILED);
97 } 98 }
98 if (error == flimflam::kUnknownString) 99 if (StringToLowerASCII(error) ==
100 StringToLowerASCII(std::string(flimflam::kUnknownString))) {
99 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); 101 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN);
100 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_STATE_UNRECOGNIZED); 102 }
103 return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR,
104 UTF8ToUTF16(error));
101 } 105 }
102 106
103 } // namespace 107 } // namespace
104 108
105 namespace ash { 109 namespace ash {
106 namespace internal { 110 namespace internal {
107 111
108 NetworkStateNotifier::NetworkStateNotifier() 112 NetworkStateNotifier::NetworkStateNotifier()
109 : cellular_out_of_credits_(false) { 113 : cellular_out_of_credits_(false) {
110 if (!NetworkStateHandler::Get()) 114 if (!NetworkStateHandler::Get())
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 cached_state_[network->path()] = network->connection_state(); 240 cached_state_[network->path()] = network->connection_state();
237 } 241 }
238 const NetworkState* default_network = 242 const NetworkState* default_network =
239 NetworkStateHandler::Get()->DefaultNetwork(); 243 NetworkStateHandler::Get()->DefaultNetwork();
240 if (default_network) 244 if (default_network)
241 last_default_network_ = default_network->path(); 245 last_default_network_ = default_network->path();
242 } 246 }
243 247
244 } // namespace internal 248 } // namespace internal
245 } // namespace ash 249 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | ash/system/chromeos/network/tray_network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698