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

Unified Diff: ash/system/network/tray_network.cc

Issue 10694043: Handle gesture events in notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + remove extra WS Created 8 years, 6 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
« no previous file with comments | « ash/system/locale/tray_locale.cc ('k') | ash/system/network/tray_sms.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/network/tray_network.cc
diff --git a/ash/system/network/tray_network.cc b/ash/system/network/tray_network.cc
index 6b66cd6adb24b23cbe6f2eecef8feecaef635c8e..3765f105c088ec7498a2c3390befa078dc4c2110 100644
--- a/ash/system/network/tray_network.cc
+++ b/ash/system/network/tray_network.cc
@@ -12,6 +12,7 @@
#include "ash/system/tray/tray_details_view.h"
#include "ash/system/tray/tray_item_more.h"
#include "ash/system/tray/tray_item_view.h"
+#include "ash/system/tray/tray_notification_view.h"
#include "ash/system/tray/tray_views.h"
#include "base/utf_string_conversions.h"
#include "grit/ash_strings.h"
@@ -661,8 +662,7 @@ class NetworkErrorView : public views::View,
class NetworkNotificationView : public TrayNotificationView {
public:
explicit NetworkNotificationView(TrayNetwork* tray)
- : TrayNotificationView(0),
- tray_(tray) {
+ : TrayNotificationView(tray, 0) {
CreateErrorView();
InitView(network_error_view_);
SetIconImage(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
@@ -671,13 +671,11 @@ class NetworkNotificationView : public TrayNotificationView {
// Overridden from TrayNotificationView.
virtual void OnClose() OVERRIDE {
- tray_->ClearNetworkError(network_error_view_->error_type());
+ tray_network()->ClearNetworkError(network_error_view_->error_type());
}
- // Overridden from views::View.
- virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE {
- tray_->PopupDetailedView(0, true);
- return true;
+ virtual void OnClickAction() OVERRIDE {
+ tray()->PopupDetailedView(0, true);
}
void Update() {
@@ -688,16 +686,19 @@ class NetworkNotificationView : public TrayNotificationView {
}
private:
+ TrayNetwork* tray_network() {
+ return static_cast<TrayNetwork*>(tray());
+ }
+
void CreateErrorView() {
// Display the first (highest priority) error.
- CHECK(!tray_->errors()->messages().empty());
+ CHECK(!tray_network()->errors()->messages().empty());
NetworkErrors::ErrorMap::const_iterator iter =
- tray_->errors()->messages().begin();
+ tray_network()->errors()->messages().begin();
network_error_view_ =
- new NetworkErrorView(tray_, iter->first, iter->second);
+ new NetworkErrorView(tray_network(), iter->first, iter->second);
}
- TrayNetwork* tray_;
tray::NetworkErrorView* network_error_view_;
DISALLOW_COPY_AND_ASSIGN(NetworkNotificationView);
« no previous file with comments | « ash/system/locale/tray_locale.cc ('k') | ash/system/network/tray_sms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698