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

Unified Diff: chrome/browser/chromeos/network_message_observer.cc

Issue 10947046: Eliminate kAshNotifyDisabled and SystemNotification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/network_message_observer.cc
diff --git a/chrome/browser/chromeos/network_message_observer.cc b/chrome/browser/chromeos/network_message_observer.cc
index dd7f9edaea943eccced67e142fd5f02f364c3389..9df2d8af7d0d4284c79fc0537b34cf5169b17830 100644
--- a/chrome/browser/chromeos/network_message_observer.cc
+++ b/chrome/browser/chromeos/network_message_observer.cc
@@ -4,21 +4,18 @@
#include "chrome/browser/chromeos/network_message_observer.h"
-#include "ash/ash_switches.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/system/network/network_observer.h"
#include "ash/system/tray/system_tray.h"
#include "base/bind.h"
#include "base/callback.h"
-#include "base/command_line.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/network_library.h"
#include "chrome/browser/chromeos/notifications/balloon_view_host_chromeos.h"
-#include "chrome/browser/chromeos/notifications/system_notification.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -73,11 +70,6 @@ class NetworkMessageNotification : public ash::NetworkTrayDelegate {
break;
}
DCHECK(!id.empty());
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kAshNotifyDisabled)) {
- system_notification_.reset(
- new SystemNotification(profile, id, icon_id, title_));
- }
}
// Overridden from ash::NetworkTrayDelegate:
@@ -88,51 +80,34 @@ class NetworkMessageNotification : public ash::NetworkTrayDelegate {
}
void Hide() {
- if (system_notification_.get()) {
- system_notification_->Hide();
- } else {
- ash::Shell::GetInstance()->system_tray()->network_observer()->
- ClearNetworkMessage(error_type_);
- }
+ ash::Shell::GetInstance()->system_tray()->network_observer()->
+ ClearNetworkMessage(error_type_);
}
void SetTitle(const string16& title) {
title_ = title;
- if (system_notification_.get()) {
- system_notification_->set_title(title);
- }
}
void Show(const string16& message,
const string16& link_text,
const BalloonViewHost::MessageCallback& callback,
bool urgent, bool sticky) {
- if (system_notification_.get()) {
- system_notification_->Show(message, link_text, callback, urgent, sticky);
- } else {
- callback_ = callback;
- std::vector<string16> links;
- links.push_back(link_text);
- ash::Shell::GetInstance()->system_tray()->network_observer()->
- SetNetworkMessage(this, error_type_, title_, message, links);
- }
+ callback_ = callback;
+ std::vector<string16> links;
+ links.push_back(link_text);
+ ash::Shell::GetInstance()->system_tray()->network_observer()->
+ SetNetworkMessage(this, error_type_, title_, message, links);
}
void ShowAlways(const string16& message,
const string16& link_text,
const BalloonViewHost::MessageCallback& callback,
bool urgent, bool sticky) {
- if (system_notification_.get()) {
- // Hide if already shown to force show it in case user has closed it.
- if (system_notification_->visible())
- system_notification_->Hide();
- }
Show(message, link_text, callback, urgent, sticky);
}
private:
string16 title_;
- scoped_ptr<SystemNotification> system_notification_;
ash::NetworkObserver::MessageType error_type_;
BalloonViewHost::MessageCallback callback_;
};
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/chromeos/notifications/system_notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698