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

Side by Side Diff: ash/system/tray/tray_background_view.h

Issue 11028134: Re-factor Ash Message Center code part 2/4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: HideBubble -> HideBubbleWithView 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
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 #ifndef ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 5 #ifndef ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/launcher/background_animator.h" 9 #include "ash/launcher/background_animator.h"
10 #include "ash/system/tray/tray_bubble_view.h"
10 #include "ash/system/tray/tray_views.h" 11 #include "ash/system/tray/tray_views.h"
11 #include "ash/wm/shelf_types.h" 12 #include "ash/wm/shelf_types.h"
12 13
13 namespace ash { 14 namespace ash {
14 namespace internal { 15 namespace internal {
15 16
16 class StatusAreaWidget; 17 class StatusAreaWidget;
17 class TrayBackground; 18 class TrayBackground;
18 class TrayLayerAnimationObserver; 19 class TrayLayerAnimationObserver;
19 20
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 76
76 // Overridden from internal::BackgroundAnimatorDelegate. 77 // Overridden from internal::BackgroundAnimatorDelegate.
77 virtual void UpdateBackground(int alpha) OVERRIDE; 78 virtual void UpdateBackground(int alpha) OVERRIDE;
78 79
79 // Called whenever the shelf alignment changes. 80 // Called whenever the shelf alignment changes.
80 virtual void SetShelfAlignment(ShelfAlignment alignment); 81 virtual void SetShelfAlignment(ShelfAlignment alignment);
81 82
82 // Called when the anchor (tray or bubble) may have moved or changed. 83 // Called when the anchor (tray or bubble) may have moved or changed.
83 virtual void AnchorUpdated() {} 84 virtual void AnchorUpdated() {}
84 85
86 // Called from GetAccessibleState, must return a valid accessible name.
85 virtual string16 GetAccessibleName() = 0; 87 virtual string16 GetAccessibleName() = 0;
86 88
89 // Hide the bubble associated with |bubble_view|. Called when the widget
90 // is closed.
jennyz 2012/10/12 23:05:34 Hide -> Hides
stevenjb 2012/10/12 23:41:50 Done.
91 virtual void HideBubbleWithView(const TrayBubbleView* bubble_view) = 0;
92
93 // Called by the bubble wrapper when a click event occurs outside the bubble.
94 // May close the bubble. Returns true if the event is handled.
95 virtual bool ClickedOutsideBubble() = 0;
96
87 // Sets |contents| as a child. 97 // Sets |contents| as a child.
88 void SetContents(views::View* contents); 98 void SetContents(views::View* contents);
89 99
90 // Creates and sets contents background to |background_|. 100 // Creates and sets contents background to |background_|.
91 void SetContentsBackground(); 101 void SetContentsBackground();
92 102
93 // Sets whether the tray paints a background. Default is true, but is set to 103 // Sets whether the tray paints a background. Default is true, but is set to
94 // false if a window overlaps the shelf. 104 // false if a window overlaps the shelf.
95 void SetPaintsBackground( 105 void SetPaintsBackground(
96 bool value, 106 bool value,
97 internal::BackgroundAnimator::ChangeType change_type); 107 internal::BackgroundAnimator::ChangeType change_type);
98 108
109 // Initialize animations for the bubble.
jennyz 2012/10/12 23:05:34 Initialize->Initializes
stevenjb 2012/10/12 23:41:50 Done.
110 void InitializeBubbleAnimations(views::Widget* bubble_widget);
111
112 // Returns the window hosting the bubble.
113 aura::Window* GetBubbleWindowContainer() const;
114
115 // Returns the anchor rect for the bubble.
116 gfx::Rect GetAnchorRect(
117 views::Widget* anchor_widget,
118 TrayBubbleView::AnchorType anchor_type,
119 TrayBubbleView::AnchorAlignment anchor_alignment) const;
120
121 // Returns the bubble anchor alignment based on |shelf_alignment_|.
122 TrayBubbleView::AnchorAlignment GetAnchorAlignment() const;
123
99 StatusAreaWidget* status_area_widget() { 124 StatusAreaWidget* status_area_widget() {
100 return status_area_widget_; 125 return status_area_widget_;
101 } 126 }
102 TrayContainer* tray_container() const { return tray_container_; } 127 TrayContainer* tray_container() const { return tray_container_; }
103 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } 128 ShelfAlignment shelf_alignment() const { return shelf_alignment_; }
104 129
105 private: 130 private:
106 friend class TrayLayerAnimationObserver; 131 friend class TrayLayerAnimationObserver;
107 132
108 // Called from Initialize after all status area trays have been created. 133 // Called from Initialize after all status area trays have been created.
(...skipping 17 matching lines...) Expand all
126 scoped_ptr<internal::TrayLayerAnimationObserver> 151 scoped_ptr<internal::TrayLayerAnimationObserver>
127 layer_animation_observer_; 152 layer_animation_observer_;
128 153
129 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); 154 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView);
130 }; 155 };
131 156
132 } // namespace internal 157 } // namespace internal
133 } // namespace ash 158 } // namespace ash
134 159
135 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 160 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698