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

Side by Side Diff: ui/views/bubble/bubble_delegate.cc

Issue 13142003: Fix app list position in windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 "ui/views/bubble/bubble_delegate.h" 5 #include "ui/views/bubble/bubble_delegate.h"
6 6
7 #include "ui/base/animation/slide_animation.h" 7 #include "ui/base/animation/slide_animation.h"
8 #include "ui/gfx/color_utils.h" 8 #include "ui/gfx/color_utils.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/native_theme/native_theme.h" 10 #include "ui/native_theme/native_theme.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 GetWidget()->Close(); 224 GetWidget()->Close();
225 } 225 }
226 226
227 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget, 227 void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget,
228 const gfx::Rect& new_bounds) { 228 const gfx::Rect& new_bounds) {
229 if (move_with_anchor() && anchor_widget() == widget) 229 if (move_with_anchor() && anchor_widget() == widget)
230 SizeToContents(); 230 SizeToContents();
231 } 231 }
232 232
233 gfx::Rect BubbleDelegateView::GetAnchorRect() { 233 gfx::Rect BubbleDelegateView::GetAnchorRect() {
234 gfx::Rect anchor_bounds = anchor_view() ? anchor_view()->GetBoundsInScreen() : 234 if (anchor_view()) {
235 gfx::Rect(anchor_point_, gfx::Size()); 235 gfx::Rect anchor_bounds = anchor_view()->GetBoundsInScreen();
236 anchor_bounds.Inset(anchor_insets_); 236 anchor_bounds.Inset(anchor_insets_);
237 return anchor_bounds; 237 return anchor_bounds;
238 } else {
239 return gfx::Rect(anchor_point_, gfx::Size());
benwells 2013/03/28 05:43:18 nit: no need for the else here, as the if() has a
240 }
238 } 241 }
239 242
240 void BubbleDelegateView::StartFade(bool fade_in) { 243 void BubbleDelegateView::StartFade(bool fade_in) {
241 fade_animation_.reset(new ui::SlideAnimation(this)); 244 fade_animation_.reset(new ui::SlideAnimation(this));
242 fade_animation_->SetSlideDuration(kHideFadeDurationMS); 245 fade_animation_->SetSlideDuration(kHideFadeDurationMS);
243 fade_animation_->Reset(fade_in ? 0.0 : 1.0); 246 fade_animation_->Reset(fade_in ? 0.0 : 1.0);
244 if (fade_in) { 247 if (fade_in) {
245 original_opacity_ = 0; 248 original_opacity_ = 0;
246 if (border_widget_) 249 if (border_widget_)
247 border_widget_->SetOpacity(original_opacity_); 250 border_widget_->SetOpacity(original_opacity_);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 #if defined(OS_WIN) && !defined(USE_AURA) 356 #if defined(OS_WIN) && !defined(USE_AURA)
354 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { 357 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const {
355 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); 358 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView());
356 client_bounds.Offset( 359 client_bounds.Offset(
357 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); 360 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin());
358 return client_bounds; 361 return client_bounds;
359 } 362 }
360 #endif 363 #endif
361 364
362 } // namespace views 365 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698