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: ui/views/bubble/bubble_frame_view.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 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 | « ui/snapshot/snapshot_android.cc ('k') | ui/views/cocoa/bridged_native_widget.mm » ('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 (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_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 } 364 }
365 365
366 // Calculate the bounds with the arrow in its updated location and offset. 366 // Calculate the bounds with the arrow in its updated location and offset.
367 return bubble_border_->GetBounds(anchor_rect, size); 367 return bubble_border_->GetBounds(anchor_rect, size);
368 } 368 }
369 369
370 gfx::Rect BubbleFrameView::GetAvailableScreenBounds( 370 gfx::Rect BubbleFrameView::GetAvailableScreenBounds(
371 const gfx::Rect& rect) const { 371 const gfx::Rect& rect) const {
372 // The bubble attempts to fit within the current screen bounds. 372 // The bubble attempts to fit within the current screen bounds.
373 // TODO(scottmg): Native is wrong. http://crbug.com/133312 373 return gfx::Screen::GetScreen()
374 return gfx::Screen::GetNativeScreen()->GetDisplayNearestPoint( 374 ->GetDisplayNearestPoint(rect.CenterPoint())
375 rect.CenterPoint()).work_area(); 375 .work_area();
376 } 376 }
377 377
378 bool BubbleFrameView::IsCloseButtonVisible() const { 378 bool BubbleFrameView::IsCloseButtonVisible() const {
379 return close_->visible(); 379 return close_->visible();
380 } 380 }
381 381
382 gfx::Rect BubbleFrameView::GetCloseButtonMirroredBounds() const { 382 gfx::Rect BubbleFrameView::GetCloseButtonMirroredBounds() const {
383 return close_->GetMirroredBounds(); 383 return close_->GetMirroredBounds();
384 } 384 }
385 385
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 if (titlebar_extra_view_ != NULL) 467 if (titlebar_extra_view_ != NULL)
468 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); 468 title_bar_width += titlebar_extra_view_->GetPreferredSize().width();
469 gfx::Size size(client_size); 469 gfx::Size size(client_size);
470 size.SetToMax(gfx::Size(title_bar_width, 0)); 470 size.SetToMax(gfx::Size(title_bar_width, 0));
471 const gfx::Insets insets(GetInsets()); 471 const gfx::Insets insets(GetInsets());
472 size.Enlarge(insets.width(), insets.height()); 472 size.Enlarge(insets.width(), insets.height());
473 return size; 473 return size;
474 } 474 }
475 475
476 } // namespace views 476 } // namespace views
OLDNEW
« no previous file with comments | « ui/snapshot/snapshot_android.cc ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698