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

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

Issue 23551004: Move Shill property utility functions to a new separate file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 3 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 | « no previous file | chromeos/chromeos.gyp » ('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/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/chromeos/network/network_connect.h" 8 #include "ash/system/chromeos/network/network_connect.h"
9 #include "ash/system/system_notifier.h" 9 #include "ash/system/system_notifier.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chromeos/network/network_configuration_handler.h" 14 #include "chromeos/network/network_configuration_handler.h"
15 #include "chromeos/network/network_connection_handler.h" 15 #include "chromeos/network/network_connection_handler.h"
16 #include "chromeos/network/network_event_log.h" 16 #include "chromeos/network/network_event_log.h"
17 #include "chromeos/network/network_state.h" 17 #include "chromeos/network/network_state.h"
18 #include "chromeos/network/network_state_handler.h" 18 #include "chromeos/network/network_state_handler.h"
19 #include "chromeos/network/shill_property_util.h"
19 #include "grit/ash_resources.h" 20 #include "grit/ash_resources.h"
20 #include "grit/ash_strings.h" 21 #include "grit/ash_strings.h"
21 #include "third_party/cros_system_api/dbus/service_constants.h" 22 #include "third_party/cros_system_api/dbus/service_constants.h"
22 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/message_center/message_center.h" 25 #include "ui/message_center/message_center.h"
25 #include "ui/message_center/notification.h" 26 #include "ui/message_center/notification.h"
26 27
27 using chromeos::NetworkConnectionHandler; 28 using chromeos::NetworkConnectionHandler;
28 using chromeos::NetworkHandler; 29 using chromeos::NetworkHandler;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 shill_properties.GetStringWithoutPathExpansion( 237 shill_properties.GetStringWithoutPathExpansion(
237 flimflam::kErrorProperty, &network_error); 238 flimflam::kErrorProperty, &network_error);
238 error = network_connect::ErrorString(network_error); 239 error = network_connect::ErrorString(network_error);
239 if (error.empty()) 240 if (error.empty())
240 error = l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); 241 error = l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN);
241 } 242 }
242 NET_LOG_ERROR("Connect error notification: " + UTF16ToUTF8(error), 243 NET_LOG_ERROR("Connect error notification: " + UTF16ToUTF8(error),
243 service_path); 244 service_path);
244 245
245 std::string network_name = 246 std::string network_name =
246 NetworkState::GetNameFromProperties(service_path, shill_properties); 247 chromeos::shill_property_util::GetNameFromProperties(service_path,
248 shill_properties);
247 std::string network_error_details; 249 std::string network_error_details;
248 shill_properties.GetStringWithoutPathExpansion( 250 shill_properties.GetStringWithoutPathExpansion(
249 shill::kErrorDetailsProperty, &network_error_details); 251 shill::kErrorDetailsProperty, &network_error_details);
250 252
251 string16 error_msg; 253 string16 error_msg;
252 if (!network_error_details.empty()) { 254 if (!network_error_details.empty()) {
253 // network_name should't be empty if network_error_details is set. 255 // network_name should't be empty if network_error_details is set.
254 error_msg = l10n_util::GetStringFUTF16( 256 error_msg = l10n_util::GetStringFUTF16(
255 IDS_NETWORK_CONNECTION_ERROR_MESSAGE_WITH_SERVER_MESSAGE, 257 IDS_NETWORK_CONNECTION_ERROR_MESSAGE_WITH_SERVER_MESSAGE,
256 UTF8ToUTF16(network_name), error, 258 UTF8ToUTF16(network_name), error,
(...skipping 13 matching lines...) Expand all
270 272
271 ShowErrorNotification( 273 ShowErrorNotification(
272 network_connect::kNetworkConnectNotificationId, 274 network_connect::kNetworkConnectNotificationId,
273 network_type, 275 network_type,
274 l10n_util::GetStringUTF16(IDS_NETWORK_CONNECTION_ERROR_TITLE), 276 l10n_util::GetStringUTF16(IDS_NETWORK_CONNECTION_ERROR_TITLE),
275 error_msg, 277 error_msg,
276 base::Bind(&network_connect::ShowNetworkSettings, service_path)); 278 base::Bind(&network_connect::ShowNetworkSettings, service_path));
277 } 279 }
278 280
279 } // namespace ash 281 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chromeos/chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698