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

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

Issue 2491033006: Adjust positioning of cros tray bubbles. (Closed)
Patch Set: rebase Created 4 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
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_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 virtual void ClickedOutsideBubble() = 0; 104 virtual void ClickedOutsideBubble() = 0;
105 105
106 // Sets |contents| as a child. 106 // Sets |contents| as a child.
107 void SetContents(views::View* contents); 107 void SetContents(views::View* contents);
108 108
109 // Creates and sets contents background to |background_|. |draws_active| 109 // Creates and sets contents background to |background_|. |draws_active|
110 // determines if the view's background should be drawn as active when the view 110 // determines if the view's background should be drawn as active when the view
111 // is in the active state. 111 // is in the active state.
112 void SetContentsBackground(bool draws_active); 112 void SetContentsBackground(bool draws_active);
113 113
114 // Returns the anchor rect for the bubble.
115 gfx::Rect GetBubbleAnchorRect(
116 views::Widget* anchor_widget,
117 views::TrayBubbleView::AnchorType anchor_type,
118 views::TrayBubbleView::AnchorAlignment anchor_alignment) const;
119
120 // Returns the bubble anchor alignment based on |shelf_alignment_|. 114 // Returns the bubble anchor alignment based on |shelf_alignment_|.
121 views::TrayBubbleView::AnchorAlignment GetAnchorAlignment() const; 115 views::TrayBubbleView::AnchorAlignment GetAnchorAlignment() const;
122 116
123 void SetIsActive(bool is_active); 117 void SetIsActive(bool is_active);
124 bool is_active() const { return is_active_; } 118 bool is_active() const { return is_active_; }
125 119
126 TrayContainer* tray_container() const { return tray_container_; } 120 TrayContainer* tray_container() const { return tray_container_; }
127 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } 121 ShelfAlignment shelf_alignment() const { return shelf_alignment_; }
128 TrayEventFilter* tray_event_filter() { return tray_event_filter_.get(); } 122 TrayEventFilter* tray_event_filter() { return tray_event_filter_.get(); }
129 WmShelf* shelf() { return wm_shelf_; } 123 WmShelf* shelf() { return wm_shelf_; }
130 124
131 // Updates the arrow visibility based on the launcher visibility. 125 // Updates the arrow visibility based on the launcher visibility.
132 void UpdateBubbleViewArrow(views::TrayBubbleView* bubble_view); 126 void UpdateBubbleViewArrow(views::TrayBubbleView* bubble_view);
133 127
134 // ShelfBackgroundAnimatorObserver: 128 // ShelfBackgroundAnimatorObserver:
135 void UpdateShelfItemBackground(int alpha) override; 129 void UpdateShelfItemBackground(int alpha) override;
136 130
137 // Updates the visibility of this tray's separator. 131 // Updates the visibility of this tray's separator.
138 void SetSeparatorVisibility(bool is_show); 132 void SetSeparatorVisibility(bool is_show);
139 133
134 // Gets the anchor for bubbles, which is tray_container().
135 views::View* GetBubbleAnchor() const;
136
137 // Gets additional insets for positioning bubbles relative to
138 // tray_container().
139 gfx::Insets GetBubbleAnchorInsets() const;
140
140 protected: 141 protected:
141 // ActionableView: 142 // ActionableView:
142 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; 143 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
143 bool ShouldEnterPushedState(const ui::Event& event) override; 144 bool ShouldEnterPushedState(const ui::Event& event) override;
144 bool PerformAction(const ui::Event& event) override; 145 bool PerformAction(const ui::Event& event) override;
145 void HandlePerformActionResult(bool action_performed, 146 void HandlePerformActionResult(bool action_performed,
146 const ui::Event& event) override; 147 const ui::Event& event) override;
147 gfx::Rect GetFocusBounds() override; 148 gfx::Rect GetFocusBounds() override;
148 149
149 private: 150 private:
(...skipping 30 matching lines...) Expand all
180 181
181 std::unique_ptr<TrayWidgetObserver> widget_observer_; 182 std::unique_ptr<TrayWidgetObserver> widget_observer_;
182 std::unique_ptr<TrayEventFilter> tray_event_filter_; 183 std::unique_ptr<TrayEventFilter> tray_event_filter_;
183 184
184 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); 185 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView);
185 }; 186 };
186 187
187 } // namespace ash 188 } // namespace ash
188 189
189 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 190 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_item.cc ('k') | ash/common/system/tray/tray_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698