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

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

Issue 11028134: Re-factor Ash Message Center code part 2/4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/tray/tray_bubble_wrapper.h ('k') | ash/system/tray/tray_event_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/system/tray/tray_bubble_wrapper.h"
6
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"
10 #include "ui/views/widget/widget.h"
11
12 namespace ash {
13 namespace internal {
14
15 TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray,
16 TrayBubbleView* bubble_view)
17 : tray_(tray),
18 bubble_view_(bubble_view) {
19 bubble_widget_ = views::BubbleDelegateView::CreateBubble(bubble_view_);
20 bubble_widget_->AddObserver(this);
21
22 bubble_view_->InitializeAndShowBubble();
23 tray_->InitializeBubbleAnimations(bubble_widget_);
24
25 tray_event_filter_.reset(new TrayEventFilter(this));
26 }
27
28 TrayBubbleWrapper::~TrayBubbleWrapper() {
29 tray_event_filter_.reset();
30 if (bubble_widget_) {
31 bubble_widget_->RemoveObserver(this);
32 bubble_widget_->Close();
33 }
34 }
35
36 void TrayBubbleWrapper::OnWidgetClosing(views::Widget* widget) {
37 CHECK_EQ(bubble_widget_, widget);
38 bubble_widget_ = NULL;
39 tray_->HideBubbleWithView(bubble_view_); // May destroy |bubble_view_|
40 }
41
42 } // namespace internal
43 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_bubble_wrapper.h ('k') | ash/system/tray/tray_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698