| Index: ui/chromeos/network/network_state_notifier.cc
|
| diff --git a/ash/system/chromeos/network/network_state_notifier.cc b/ui/chromeos/network/network_state_notifier.cc
|
| similarity index 94%
|
| rename from ash/system/chromeos/network/network_state_notifier.cc
|
| rename to ui/chromeos/network/network_state_notifier.cc
|
| index 7867b924fe04f56edaeefdb1d6d93deb07a19ae0..a5b5ac5308973501e54f1611d8b7a35ee194d3a7 100644
|
| --- a/ash/system/chromeos/network/network_state_notifier.cc
|
| +++ b/ui/chromeos/network/network_state_notifier.cc
|
| @@ -2,10 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ash/system/chromeos/network/network_state_notifier.h"
|
| +#include "ui/chromeos/network/network_state_notifier.h"
|
|
|
| -#include "ash/system/chromeos/network/network_connect.h"
|
| -#include "ash/system/system_notifier.h"
|
| #include "base/bind.h"
|
| #include "base/location.h"
|
| #include "base/strings/string16.h"
|
| @@ -17,12 +15,12 @@
|
| #include "chromeos/network/network_state.h"
|
| #include "chromeos/network/network_state_handler.h"
|
| #include "chromeos/network/shill_property_util.h"
|
| -#include "grit/ash_resources.h"
|
| -#include "grit/ash_strings.h"
|
| -#include "grit/ui_chromeos_resources.h"
|
| #include "third_party/cros_system_api/dbus/service_constants.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/chromeos/network/network_connect.h"
|
| +#include "ui/chromeos/resources/grit/ui_chromeos_resources.h"
|
| +#include "ui/chromeos/strings/grit/ui_chromeos_strings.h"
|
| #include "ui/message_center/message_center.h"
|
| #include "ui/message_center/notification.h"
|
|
|
| @@ -55,7 +53,7 @@ base::string16 GetConnectErrorString(const std::string& error_name) {
|
| return l10n_util::GetStringUTF16(
|
| IDS_CHROMEOS_NETWORK_ERROR_CERTIFICATES_NOT_LOADED);
|
| }
|
| - if (error_name == ash::NetworkConnect::kErrorActivateFailed) {
|
| + if (error_name == ui::NetworkConnect::kErrorActivateFailed) {
|
| return l10n_util::GetStringUTF16(
|
| IDS_CHROMEOS_NETWORK_ERROR_ACTIVATION_FAILED);
|
| }
|
| @@ -68,19 +66,23 @@ void ShowErrorNotification(const std::string& notification_id,
|
| const base::string16& message,
|
| const base::Closure& callback) {
|
| int icon_id = (network_type == shill::kTypeCellular)
|
| - ? IDR_AURA_UBER_TRAY_CELLULAR_NETWORK_FAILED
|
| + ? IDR_AURA_UBER_TRAY_NETWORK_FAILED_CELLULAR
|
| : IDR_AURA_UBER_TRAY_NETWORK_FAILED;
|
| const gfx::Image& icon =
|
| ui::ResourceBundle::GetSharedInstance().GetImageNamed(icon_id);
|
| message_center::MessageCenter::Get()->AddNotification(
|
| message_center::Notification::CreateSystemNotification(
|
| notification_id, title, message, icon,
|
| - ash::system_notifier::kNotifierNetworkError, callback));
|
| + ui::NetworkStateNotifier::kNotifierNetworkError, callback));
|
| }
|
|
|
| } // namespace
|
|
|
| -namespace ash {
|
| +namespace ui {
|
| +
|
| +const char NetworkStateNotifier::kNotifierNetwork[] = "ui.chromeos.network";
|
| +const char NetworkStateNotifier::kNotifierNetworkError[] =
|
| + "ui.chromeos.network.error";
|
|
|
| const char NetworkStateNotifier::kNetworkConnectNotificationId[] =
|
| "chrome://settings/internet/connect";
|
| @@ -197,7 +199,7 @@ void NetworkStateNotifier::UpdateCellularActivating(
|
| l10n_util::GetStringUTF16(IDS_NETWORK_CELLULAR_ACTIVATED_TITLE),
|
| l10n_util::GetStringFUTF16(IDS_NETWORK_CELLULAR_ACTIVATED,
|
| base::UTF8ToUTF16((cellular->name()))),
|
| - icon, system_notifier::kNotifierNetwork,
|
| + icon, kNotifierNetwork,
|
| base::Bind(&NetworkStateNotifier::ShowNetworkSettings,
|
| weak_ptr_factory_.GetWeakPtr(), cellular->path())));
|
| }
|
| @@ -236,8 +238,8 @@ void NetworkStateNotifier::ShowMobileActivationError(
|
| l10n_util::GetStringFUTF16(IDS_NETWORK_ACTIVATION_NEEDS_CONNECTION,
|
| base::UTF8ToUTF16(cellular->name())),
|
| ui::ResourceBundle::GetSharedInstance().GetImageNamed(
|
| - IDR_AURA_UBER_TRAY_CELLULAR_NETWORK_FAILED),
|
| - ash::system_notifier::kNotifierNetworkError,
|
| + IDR_AURA_UBER_TRAY_NETWORK_FAILED_CELLULAR),
|
| + kNotifierNetworkError,
|
| base::Bind(&NetworkStateNotifier::ShowNetworkSettings,
|
| weak_ptr_factory_.GetWeakPtr(), service_path)));
|
| }
|
| @@ -360,4 +362,4 @@ void NetworkStateNotifier::ShowNetworkSettings(
|
| network_connect_->ShowNetworkSettings(service_path);
|
| }
|
|
|
| -} // namespace ash
|
| +} // namespace ui
|
|
|