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 "chrome/browser/ui/views/panels/panel_view.h" | 5 #include "chrome/browser/ui/views/panels/panel_view.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include "base/logging.h" | 8 #include "base/logging.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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 } | 903 } |
904 | 904 |
905 gfx::Size PanelView::GetMinimumSize() const { | 905 gfx::Size PanelView::GetMinimumSize() const { |
906 // If the panel is minimized, it can be rendered to very small size, like | 906 // If the panel is minimized, it can be rendered to very small size, like |
907 // 4-pixel lines when it is docked. Otherwise, its size should not be less | 907 // 4-pixel lines when it is docked. Otherwise, its size should not be less |
908 // than its minimum size. | 908 // than its minimum size. |
909 return panel_->IsMinimized() ? gfx::Size() : | 909 return panel_->IsMinimized() ? gfx::Size() : |
910 gfx::Size(panel::kPanelMinWidth, panel::kPanelMinHeight); | 910 gfx::Size(panel::kPanelMinWidth, panel::kPanelMinHeight); |
911 } | 911 } |
912 | 912 |
913 gfx::Size PanelView::GetMaximumSize() { | 913 gfx::Size PanelView::GetMaximumSize() const { |
914 // If the user is resizing a stacked panel by its bottom edge, make sure its | 914 // If the user is resizing a stacked panel by its bottom edge, make sure its |
915 // height cannot grow more than what the panel below it could offer. This is | 915 // height cannot grow more than what the panel below it could offer. This is |
916 // because growing a stacked panel by y amount will shrink the panel below it | 916 // because growing a stacked panel by y amount will shrink the panel below it |
917 // by same amount and we do not want the panel below it being shrunk to be | 917 // by same amount and we do not want the panel below it being shrunk to be |
918 // smaller than the titlebar. | 918 // smaller than the titlebar. |
919 #if defined(OS_WIN) | 919 #if defined(OS_WIN) |
920 if (panel_->stack() && user_resizing_interior_stacked_panel_edge_) { | 920 if (panel_->stack() && user_resizing_interior_stacked_panel_edge_) { |
921 Panel* below_panel = panel_->stack()->GetPanelBelow(panel_.get()); | 921 Panel* below_panel = panel_->stack()->GetPanelBelow(panel_.get()); |
922 if (below_panel && !below_panel->IsMinimized()) { | 922 if (below_panel && !below_panel->IsMinimized()) { |
923 return gfx::Size(0, below_panel->GetBounds().bottom() - | 923 return gfx::Size(0, below_panel->GetBounds().bottom() - |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 // SWP_FRAMECHANGED flag must be called in order for the cached window data | 1125 // SWP_FRAMECHANGED flag must be called in order for the cached window data |
1126 // to be updated properly. | 1126 // to be updated properly. |
1127 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx | 1127 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a
spx |
1128 if (update_frame) { | 1128 if (update_frame) { |
1129 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, | 1129 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, |
1130 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | | 1130 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | |
1131 SWP_NOZORDER | SWP_NOACTIVATE); | 1131 SWP_NOZORDER | SWP_NOACTIVATE); |
1132 } | 1132 } |
1133 } | 1133 } |
1134 #endif | 1134 #endif |
OLD | NEW |