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

Side by Side Diff: ui/views/widget/widget.cc

Issue 9749003: Revert 127660 - WebUI TaskManager: Add method to set minimum window size on HTMLDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/widget.h ('k') | 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/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/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 void Widget::SetBounds(const gfx::Rect& bounds) { 447 void Widget::SetBounds(const gfx::Rect& bounds) {
448 native_widget_->SetBounds(bounds); 448 native_widget_->SetBounds(bounds);
449 } 449 }
450 450
451 void Widget::SetSize(const gfx::Size& size) { 451 void Widget::SetSize(const gfx::Size& size) {
452 native_widget_->SetSize(size); 452 native_widget_->SetSize(size);
453 } 453 }
454 454
455 void Widget::CenterWindow(const gfx::Size& size) {
456 native_widget_->CenterWindow(size);
457 }
458
459 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) { 455 void Widget::SetBoundsConstrained(const gfx::Rect& bounds) {
460 gfx::Rect work_area = 456 gfx::Rect work_area =
461 gfx::Screen::GetMonitorWorkAreaNearestPoint(bounds.origin()); 457 gfx::Screen::GetMonitorWorkAreaNearestPoint(bounds.origin());
462 if (work_area.IsEmpty()) { 458 if (work_area.IsEmpty()) {
463 SetBounds(bounds); 459 SetBounds(bounds);
464 } else { 460 } else {
465 // Inset the work area slightly. 461 // Inset the work area slightly.
466 work_area.Inset(10, 10, 10, 10); 462 work_area.Inset(10, 10, 10, 10);
467 SetBounds(work_area.AdjustToFit(bounds)); 463 SetBounds(work_area.AdjustToFit(bounds));
468 } 464 }
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 1300
1305 //////////////////////////////////////////////////////////////////////////////// 1301 ////////////////////////////////////////////////////////////////////////////////
1306 // internal::NativeWidgetPrivate, NativeWidget implementation: 1302 // internal::NativeWidgetPrivate, NativeWidget implementation:
1307 1303
1308 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1304 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1309 return this; 1305 return this;
1310 } 1306 }
1311 1307
1312 } // namespace internal 1308 } // namespace internal
1313 } // namespace views 1309 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698