OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |