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

Side by Side Diff: ui/views/widget/widget.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, 10 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
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/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 void Widget::SetSize(const gfx::Size& size) { 503 void Widget::SetSize(const gfx::Size& size) {
504 native_widget_->SetSize(size); 504 native_widget_->SetSize(size);
505 } 505 }
506 506
507 void Widget::CenterWindow(const gfx::Size& size) { 507 void Widget::CenterWindow(const gfx::Size& size) {
508 native_widget_->CenterWindow(size); 508 native_widget_->CenterWindow(size);
509 } 509 }
510 510
511 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { 511 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) {
512 gfx::Rect work_area = 512 gfx::Rect work_area = gfx::Screen::GetScreen()
513 gfx::Screen::GetScreenFor(GetNativeView())->GetDisplayNearestPoint( 513 ->GetDisplayNearestPoint(bounds.origin())
514 bounds.origin()).work_area(); 514 .work_area();
515 if (work_area.IsEmpty()) { 515 if (work_area.IsEmpty()) {
516 SetBounds(bounds); 516 SetBounds(bounds);
517 } else { 517 } else {
518 // Inset the work area slightly. 518 // Inset the work area slightly.
519 work_area.Inset(10, 10, 10, 10); 519 work_area.Inset(10, 10, 10, 10);
520 work_area.AdjustToFit(bounds); 520 work_area.AdjustToFit(bounds);
521 SetBounds(work_area); 521 SetBounds(work_area);
522 } 522 }
523 } 523 }
524 524
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 1490
1491 //////////////////////////////////////////////////////////////////////////////// 1491 ////////////////////////////////////////////////////////////////////////////////
1492 // internal::NativeWidgetPrivate, NativeWidget implementation: 1492 // internal::NativeWidgetPrivate, NativeWidget implementation:
1493 1493
1494 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1494 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1495 return this; 1495 return this;
1496 } 1496 }
1497 1497
1498 } // namespace internal 1498 } // namespace internal
1499 } // namespace views 1499 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/tooltip_manager_aura.cc ('k') | ui/views_content_client/views_content_client_main_parts_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698