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

Side by Side Diff: ash/system/tray/tray_bubble_wrapper.cc

Issue 11229022: Move ash/system/web_notification message_center to ui/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again. Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/tray_bubble_wrapper.h ('k') | ash/system/tray/tray_event_filter.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/tray/tray_bubble_wrapper.h" 5 #include "ash/system/tray/tray_bubble_wrapper.h"
6 6
7 #include "ash/system/tray/tray_background_view.h" 7 #include "ash/system/tray/tray_background_view.h"
8 #include "ash/system/tray/tray_bubble_view.h"
9 #include "ash/system/tray/tray_event_filter.h" 8 #include "ash/system/tray/tray_event_filter.h"
10 #include "ash/wm/window_properties.h" 9 #include "ash/wm/window_properties.h"
10 #include "ui/views/bubble/tray_bubble_view.h"
11 #include "ui/views/widget/widget.h" 11 #include "ui/views/widget/widget.h"
12 12
13 using message_center::TrayBubbleView;
14
15 namespace ash { 13 namespace ash {
16 namespace internal { 14 namespace internal {
17 15
18 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray, 16 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray,
19 TrayBubbleView* bubble_view) 17 views::TrayBubbleView* bubble_view)
20 : tray_(tray), 18 : tray_(tray),
21 bubble_view_(bubble_view) { 19 bubble_view_(bubble_view) {
22 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_); 20 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_);
23 bubble_widget_->AddObserver(this); 21 bubble_widget_->AddObserver(this);
24 bubble_widget_->GetNativeView()-> 22 bubble_widget_->GetNativeView()->
25 SetProperty(internal::kStayInSameRootWindowKey, true); 23 SetProperty(internal::kStayInSameRootWindowKey, true);
26 24
27 bubble_view_->InitializeAndShowBubble(); 25 bubble_view_->InitializeAndShowBubble();
28 tray_->InitializeBubbleAnimations(bubble_widget_); 26 tray_->InitializeBubbleAnimations(bubble_widget_);
27 tray_->UpdateBubbleViewArrow(bubble_view_);
29 28
30 tray_event_filter_.reset(new TrayEventFilter(this)); 29 tray_event_filter_.reset(new TrayEventFilter(this));
31 } 30 }
32 31
33 TrayBubbleWrapper::~TrayBubbleWrapper() { 32 TrayBubbleWrapper::~TrayBubbleWrapper() {
34 tray_event_filter_.reset(); 33 tray_event_filter_.reset();
35 if (bubble_widget_) { 34 if (bubble_widget_) {
36 bubble_widget_->RemoveObserver(this); 35 bubble_widget_->RemoveObserver(this);
37 bubble_widget_->Close(); 36 bubble_widget_->Close();
38 } 37 }
39 } 38 }
40 39
41 void TrayBubbleWrapper::OnWidgetClosing(views::Widget* widget) { 40 void TrayBubbleWrapper::OnWidgetClosing(views::Widget* widget) {
42 CHECK_EQ(bubble_widget_, widget); 41 CHECK_EQ(bubble_widget_, widget);
43 bubble_widget_ = NULL; 42 bubble_widget_ = NULL;
44 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_| 43 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_|
45 } 44 }
46 45
47 } // namespace internal 46 } // namespace internal
48 } // namespace ash 47 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_bubble_wrapper.h ('k') | ash/system/tray/tray_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698