diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-25 19:26:25 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-25 19:26:25 +0000 |
commit | 25cf28e20a9c8a16bea2ccd2980c76bc180cb249 (patch) | |
tree | 27fd0ae7a71cda2360406ebd4f983e6d44457d70 /ash | |
parent | da2205606ebdb5643d8c4e95b3e3895defc4eb88 (diff) | |
download | chromium_src-25cf28e20a9c8a16bea2ccd2980c76bc180cb249.zip chromium_src-25cf28e20a9c8a16bea2ccd2980c76bc180cb249.tar.gz chromium_src-25cf28e20a9c8a16bea2ccd2980c76bc180cb249.tar.bz2 |
Suppress error notifications and detailed view during OOBE
BUG=222113,222104
For ash/ash_chromeos_strings.grdp
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/12843019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash_chromeos_strings.grdp | 3 | ||||
-rw-r--r-- | ash/system/chromeos/network/network_state_notifier.cc | 8 | ||||
-rw-r--r-- | ash/system/chromeos/network/tray_network.cc | 2 | ||||
-rw-r--r-- | ash/system/tray/system_tray_delegate.h | 1 | ||||
-rw-r--r-- | ash/system/tray/system_tray_item.cc | 5 | ||||
-rw-r--r-- | ash/system/tray/test_system_tray_delegate.cc | 4 | ||||
-rw-r--r-- | ash/system/tray/test_system_tray_delegate.h | 1 |
7 files changed, 22 insertions, 2 deletions
diff --git a/ash/ash_chromeos_strings.grdp b/ash/ash_chromeos_strings.grdp index 0343d82..70dee20 100644 --- a/ash/ash_chromeos_strings.grdp +++ b/ash/ash_chromeos_strings.grdp @@ -126,6 +126,9 @@ <message name="IDS_NETWORK_OUT_OF_CREDITS_LINK" desc="Link text for network out of data error notification"> Visit the <ph name="name">$1<ex>GoogleGuest</ex></ph> activation portal to buy more data. </message> + <message name="IDS_NETWORK_UNRECOGNIZED_ERROR" desc="Unrecognized Network error text"> + Unrecognized error: <ph name="desc">$1<ex>ShillErrorString</ex></ph> + </message> <!-- Network state strings --> <message name="IDS_CHROMEOS_NETWORK_STATE_UNKNOWN" desc="Network state in about:network: UNKNOWN"> diff --git a/ash/system/chromeos/network/network_state_notifier.cc b/ash/system/chromeos/network/network_state_notifier.cc index 022c7c6..ba42c90 100644 --- a/ash/system/chromeos/network/network_state_notifier.cc +++ b/ash/system/chromeos/network/network_state_notifier.cc @@ -10,6 +10,7 @@ #include "ash/system/tray/system_tray_notifier.h" #include "base/command_line.h" #include "base/string16.h" +#include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_state.h" @@ -95,9 +96,12 @@ string16 GetErrorString(const std::string& error) { return l10n_util::GetStringUTF16( IDS_CHROMEOS_NETWORK_ERROR_PPP_AUTH_FAILED); } - if (error == flimflam::kUnknownString) + if (StringToLowerASCII(error) == + StringToLowerASCII(std::string(flimflam::kUnknownString))) { return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); - return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_STATE_UNRECOGNIZED); + } + return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR, + UTF8ToUTF16(error)); } } // namespace diff --git a/ash/system/chromeos/network/tray_network.cc b/ash/system/chromeos/network/tray_network.cc index 51229c5..90e66b1 100644 --- a/ash/system/chromeos/network/tray_network.cc +++ b/ash/system/chromeos/network/tray_network.cc @@ -506,6 +506,8 @@ void TrayNetwork::SetNetworkMessage(NetworkTrayDelegate* delegate, const std::vector<string16>& links) { messages_->messages()[message_type] = tray::NetworkMessages::Message( delegate, network_type, title, message, links); + if (!Shell::GetInstance()->system_tray_delegate()->IsOobeCompleted()) + return; if (notification_) notification_->Update(); else diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h index 382227d..2e05dc71 100644 --- a/ash/system/tray/system_tray_delegate.h +++ b/ash/system/tray/system_tray_delegate.h @@ -126,6 +126,7 @@ class SystemTrayDelegate { virtual const std::string GetUserEmail() const = 0; virtual const gfx::ImageSkia& GetUserImage() const = 0; virtual user::LoginStatus GetUserLoginStatus() const = 0; + virtual bool IsOobeCompleted() const = 0; // Shows UI for changing user's profile picture. virtual void ChangeProfilePicture() = 0; diff --git a/ash/system/tray/system_tray_item.cc b/ash/system/tray/system_tray_item.cc index 7fb9d78..b2acf08 100644 --- a/ash/system/tray/system_tray_item.cc +++ b/ash/system/tray/system_tray_item.cc @@ -4,7 +4,9 @@ #include "ash/system/tray/system_tray_item.h" +#include "ash/shell.h" #include "ash/system/tray/system_tray.h" +#include "ash/system/tray/system_tray_delegate.h" #include "ui/views/view.h" namespace ash { @@ -55,6 +57,9 @@ void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { } void SystemTrayItem::PopupDetailedView(int for_seconds, bool activate) { + // Never show a detailed view during OOBE, e.g. from a notification. + if (!Shell::GetInstance()->system_tray_delegate()->IsOobeCompleted()) + return; system_tray()->ShowDetailedView( this, for_seconds, activate, BUBBLE_CREATE_NEW); } diff --git a/ash/system/tray/test_system_tray_delegate.cc b/ash/system/tray/test_system_tray_delegate.cc index 20eab02..afc5f82 100644 --- a/ash/system/tray/test_system_tray_delegate.cc +++ b/ash/system/tray/test_system_tray_delegate.cc @@ -96,6 +96,10 @@ user::LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { return user::LOGGED_IN_USER; } +bool TestSystemTrayDelegate::IsOobeCompleted() const { + return true; +} + void TestSystemTrayDelegate::ChangeProfilePicture() { } diff --git a/ash/system/tray/test_system_tray_delegate.h b/ash/system/tray/test_system_tray_delegate.h index 426f97af..ee859a2 100644 --- a/ash/system/tray/test_system_tray_delegate.h +++ b/ash/system/tray/test_system_tray_delegate.h @@ -29,6 +29,7 @@ class TestSystemTrayDelegate : public SystemTrayDelegate { virtual const std::string GetUserEmail() const OVERRIDE; virtual const gfx::ImageSkia& GetUserImage() const OVERRIDE; virtual user::LoginStatus GetUserLoginStatus() const OVERRIDE; + virtual bool IsOobeCompleted() const OVERRIDE; virtual void ChangeProfilePicture() OVERRIDE; virtual const std::string GetEnterpriseDomain() const OVERRIDE; virtual const string16 GetEnterpriseMessage() const OVERRIDE; |