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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 12375004: Re-home the global MessageCenter to support Ash+Win environments. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge master. Created 7 years, 9 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
« no previous file with comments | « ash/shell.cc ('k') | ash/test/ash_test_base.cc » ('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/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 : TrayBackgroundView(status_area_widget), 91 : TrayBackgroundView(status_area_widget),
92 button_(NULL), 92 button_(NULL),
93 show_message_center_on_unlock_(false) { 93 show_message_center_on_unlock_(false) {
94 button_ = new views::ImageButton(this); 94 button_ = new views::ImageButton(this);
95 button_->set_triggerable_event_flags( 95 button_->set_triggerable_event_flags(
96 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON); 96 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON);
97 tray_container()->AddChildView(button_); 97 tray_container()->AddChildView(button_);
98 SetVisible(false); 98 SetVisible(false);
99 message_center_tray_.reset(new message_center::MessageCenterTray( 99 message_center_tray_.reset(new message_center::MessageCenterTray(
100 this, 100 this,
101 Shell::GetInstance()->message_center())); 101 message_center::MessageCenter::Get()));
102 OnMessageCenterTrayChanged(); 102 OnMessageCenterTrayChanged();
103 } 103 }
104 104
105 WebNotificationTray::~WebNotificationTray() { 105 WebNotificationTray::~WebNotificationTray() {
106 // Release any child views that might have back pointers before ~View(). 106 // Release any child views that might have back pointers before ~View().
107 message_center_bubble_.reset(); 107 message_center_bubble_.reset();
108 popup_bubble_.reset(); 108 popup_bubble_.reset();
109 popup_collection_.reset(); 109 popup_collection_.reset();
110 if (quiet_mode_bubble() && quiet_mode_bubble()->GetBubbleWidget()) 110 if (quiet_mode_bubble() && quiet_mode_bubble()->GetBubbleWidget())
111 quiet_mode_bubble()->GetBubbleWidget()->RemoveObserver(this); 111 quiet_mode_bubble()->GetBubbleWidget()->RemoveObserver(this);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 message_center::MessagePopupBubble* 453 message_center::MessagePopupBubble*
454 WebNotificationTray::GetPopupBubbleForTest() { 454 WebNotificationTray::GetPopupBubbleForTest() {
455 if (!popup_bubble()) 455 if (!popup_bubble())
456 return NULL; 456 return NULL;
457 return static_cast<message_center::MessagePopupBubble*>( 457 return static_cast<message_center::MessagePopupBubble*>(
458 popup_bubble()->bubble()); 458 popup_bubble()->bubble());
459 } 459 }
460 460
461 } // namespace ash 461 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698