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 "components/constrained_window/constrained_window_views.h" | 5 #include "components/constrained_window/constrained_window_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 GetClientAreaBoundsInScreen().OffsetFromOrigin(); | 98 GetClientAreaBoundsInScreen().OffsetFromOrigin(); |
99 } | 99 } |
100 | 100 |
101 widget->SetBounds(gfx::Rect(position, size)); | 101 widget->SetBounds(gfx::Rect(position, size)); |
102 } | 102 } |
103 | 103 |
104 } // namespace | 104 } // namespace |
105 | 105 |
106 // static | 106 // static |
107 void SetConstrainedWindowViewsClient( | 107 void SetConstrainedWindowViewsClient( |
108 scoped_ptr<ConstrainedWindowViewsClient> new_client) { | 108 std::unique_ptr<ConstrainedWindowViewsClient> new_client) { |
109 delete constrained_window_views_client; | 109 delete constrained_window_views_client; |
110 constrained_window_views_client = new_client.release(); | 110 constrained_window_views_client = new_client.release(); |
111 } | 111 } |
112 | 112 |
113 void UpdateWebContentsModalDialogPosition( | 113 void UpdateWebContentsModalDialogPosition( |
114 views::Widget* widget, | 114 views::Widget* widget, |
115 web_modal::WebContentsModalDialogHost* dialog_host) { | 115 web_modal::WebContentsModalDialogHost* dialog_host) { |
116 gfx::Size size = widget->GetRootView()->GetPreferredSize(); | 116 gfx::Size size = widget->GetRootView()->GetPreferredSize(); |
117 gfx::Size max_size = dialog_host->GetMaximumDialogSize(); | 117 gfx::Size max_size = dialog_host->GetMaximumDialogSize(); |
118 // Enlarge the max size by the top border, as the dialog will be shifted | 118 // Enlarge the max size by the top border, as the dialog will be shifted |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 DCHECK_EQ(parent_view, host->GetHostView()); | 186 DCHECK_EQ(parent_view, host->GetHostView()); |
187 ModalDialogHostObserver* dialog_host_observer = | 187 ModalDialogHostObserver* dialog_host_observer = |
188 new WidgetModalDialogHostObserverViews( | 188 new WidgetModalDialogHostObserverViews( |
189 host, widget, kWidgetModalDialogHostObserverViewsKey); | 189 host, widget, kWidgetModalDialogHostObserverViewsKey); |
190 dialog_host_observer->OnPositionRequiresUpdate(); | 190 dialog_host_observer->OnPositionRequiresUpdate(); |
191 } | 191 } |
192 return widget; | 192 return widget; |
193 } | 193 } |
194 | 194 |
195 } // namespace constrained window | 195 } // namespace constrained window |
OLD | NEW |