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

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

Issue 9452008: Allow platform apps to specify a maximum size for the shell container. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing file 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/view.h ('k') | ui/views/widget/native_widget_delegate.h » ('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/view.h" 5 #include "ui/views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 void View::SizeToPreferredSize() { 374 void View::SizeToPreferredSize() {
375 gfx::Size prefsize = GetPreferredSize(); 375 gfx::Size prefsize = GetPreferredSize();
376 if ((prefsize.width() != width()) || (prefsize.height() != height())) 376 if ((prefsize.width() != width()) || (prefsize.height() != height()))
377 SetBounds(x(), y(), prefsize.width(), prefsize.height()); 377 SetBounds(x(), y(), prefsize.width(), prefsize.height());
378 } 378 }
379 379
380 gfx::Size View::GetMinimumSize() { 380 gfx::Size View::GetMinimumSize() {
381 return GetPreferredSize(); 381 return GetPreferredSize();
382 } 382 }
383 383
384 gfx::Size View::GetMaximumSize() {
385 return gfx::Size();
386 }
387
384 int View::GetHeightForWidth(int w) { 388 int View::GetHeightForWidth(int w) {
385 if (layout_manager_.get()) 389 if (layout_manager_.get())
386 return layout_manager_->GetPreferredHeightForWidth(this, w); 390 return layout_manager_->GetPreferredHeightForWidth(this, w);
387 return GetPreferredSize().height(); 391 return GetPreferredSize().height();
388 } 392 }
389 393
390 void View::SetVisible(bool visible) { 394 void View::SetVisible(bool visible) {
391 if (visible != visible_) { 395 if (visible != visible_) {
392 // If the View is currently visible, schedule paint to refresh parent. 396 // If the View is currently visible, schedule paint to refresh parent.
393 // TODO(beng): not sure we should be doing this if we have a layer. 397 // TODO(beng): not sure we should be doing this if we have a layer.
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 2070
2067 // Message the RootView to do the drag and drop. That way if we're removed 2071 // Message the RootView to do the drag and drop. That way if we're removed
2068 // the RootView can detect it and avoid calling us back. 2072 // the RootView can detect it and avoid calling us back.
2069 gfx::Point widget_location(event.location()); 2073 gfx::Point widget_location(event.location());
2070 ConvertPointToWidget(this, &widget_location); 2074 ConvertPointToWidget(this, &widget_location);
2071 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); 2075 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations);
2072 #endif // !defined(OS_MACOSX) 2076 #endif // !defined(OS_MACOSX)
2073 } 2077 }
2074 2078
2075 } // namespace views 2079 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | ui/views/widget/native_widget_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698