OLD | NEW |
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/launcher/overflow_bubble.h" | 5 #include "ash/launcher/overflow_bubble.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
10 #include "ash/launcher/launcher_view.h" | 10 #include "ash/launcher/launcher_view.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 193 } |
194 | 194 |
195 gfx::Rect OverflowBubbleView::GetBubbleBounds() { | 195 gfx::Rect OverflowBubbleView::GetBubbleBounds() { |
196 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); | 196 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); |
197 gfx::Insets bubble_insets = border->GetInsets(); | 197 gfx::Insets bubble_insets = border->GetInsets(); |
198 | 198 |
199 const int border_size = | 199 const int border_size = |
200 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? | 200 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? |
201 bubble_insets.left() : bubble_insets.top(); | 201 bubble_insets.left() : bubble_insets.top(); |
202 const int arrow_offset = border_size + kPadding + kLauncherViewLeadingInset + | 202 const int arrow_offset = border_size + kPadding + kLauncherViewLeadingInset + |
203 kLauncherPreferredSize / 2; | 203 ShelfLayoutManager::GetPreferredShelfSize() / 2; |
204 | 204 |
205 const gfx::Size content_size = GetPreferredSize(); | 205 const gfx::Size content_size = GetPreferredSize(); |
206 border->set_arrow_offset(arrow_offset); | 206 border->set_arrow_offset(arrow_offset); |
207 | 207 |
208 const gfx::Rect anchor_rect = GetAnchorRect(); | 208 const gfx::Rect anchor_rect = GetAnchorRect(); |
209 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( | 209 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( |
210 anchor_rect, | 210 anchor_rect, |
211 content_size, | 211 content_size, |
212 false); | 212 false); |
213 | 213 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 273 } |
274 | 274 |
275 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { | 275 void OverflowBubble::OnWidgetDestroying(views::Widget* widget) { |
276 DCHECK(widget == bubble_->GetWidget()); | 276 DCHECK(widget == bubble_->GetWidget()); |
277 bubble_ = NULL; | 277 bubble_ = NULL; |
278 launcher_view_ = NULL; | 278 launcher_view_ = NULL; |
279 } | 279 } |
280 | 280 |
281 } // namespace internal | 281 } // namespace internal |
282 } // namespace ash | 282 } // namespace ash |
OLD | NEW |