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

Side by Side Diff: ash/shelf/overflow_bubble_view.cc

Issue 229453005: Shelf Cleanup AlternateShelfLayout P1 Attempt 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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/shelf/app_list_button.cc ('k') | ash/shelf/overflow_button.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/shelf/overflow_bubble_view.h" 5 #include "ash/shelf/overflow_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shelf/shelf_constants.h" 10 #include "ash/shelf/shelf_constants.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 gfx::Rect OverflowBubbleView::GetBubbleBounds() { 179 gfx::Rect OverflowBubbleView::GetBubbleBounds() {
180 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border(); 180 views::BubbleBorder* border = GetBubbleFrameView()->bubble_border();
181 gfx::Insets bubble_insets = border->GetInsets(); 181 gfx::Insets bubble_insets = border->GetInsets();
182 182
183 const int border_size = 183 const int border_size =
184 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ? 184 views::BubbleBorder::is_arrow_on_horizontal(arrow()) ?
185 bubble_insets.left() : bubble_insets.top(); 185 bubble_insets.left() : bubble_insets.top();
186 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset + 186 const int arrow_offset = border_size + kPadding + kShelfViewLeadingInset +
187 ShelfLayoutManager::GetPreferredShelfSize() / 2; 187 kShelfSize / 2;
188 188
189 const gfx::Size content_size = GetPreferredSize(); 189 const gfx::Size content_size = GetPreferredSize();
190 border->set_arrow_offset(arrow_offset); 190 border->set_arrow_offset(arrow_offset);
191 191
192 const gfx::Rect anchor_rect = GetAnchorRect(); 192 const gfx::Rect anchor_rect = GetAnchorRect();
193 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds( 193 gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds(
194 anchor_rect, 194 anchor_rect,
195 content_size, 195 content_size,
196 false); 196 false);
197 197
(...skipping 17 matching lines...) Expand all
215 215
216 bubble_rect.Offset(0, offset); 216 bubble_rect.Offset(0, offset);
217 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y()); 217 border->set_arrow_offset(anchor_rect.CenterPoint().y() - bubble_rect.y());
218 } 218 }
219 219
220 GetBubbleFrameView()->SchedulePaint(); 220 GetBubbleFrameView()->SchedulePaint();
221 return bubble_rect; 221 return bubble_rect;
222 } 222 }
223 223
224 } // namespace ash 224 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/app_list_button.cc ('k') | ash/shelf/overflow_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698