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

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

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

Powered by Google App Engine
This is Rietveld 408576698