| Index: chrome/browser/ui/views/constrained_window_views.cc
|
| diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
|
| index 2aaf122a177c2f81929b7e117daa11edd070a1e9..653a6963077cf435db4eeafaa619caaaf9f56f62 100644
|
| --- a/chrome/browser/ui/views/constrained_window_views.cc
|
| +++ b/chrome/browser/ui/views/constrained_window_views.cc
|
| @@ -584,9 +584,28 @@ ConstrainedWindowViews::ConstrainedWindowViews(
|
| bool enable_chrome_style)
|
| : WebContentsObserver(web_contents),
|
| web_contents_(web_contents),
|
| - ALLOW_THIS_IN_INITIALIZER_LIST(native_constrained_window_(
|
| - NativeConstrainedWindow::CreateNativeConstrainedWindow(this))),
|
| - enable_chrome_style_(enable_chrome_style) {
|
| + enable_chrome_style_(enable_chrome_style),
|
| + custom_client_insets_(false) {
|
| + InitConstrainedWindowViews(widget_delegate);
|
| +}
|
| +
|
| +ConstrainedWindowViews::ConstrainedWindowViews(
|
| + content::WebContents* web_contents,
|
| + views::WidgetDelegate* widget_delegate,
|
| + bool enable_chrome_style,
|
| + const gfx::Insets& client_insets)
|
| + : WebContentsObserver(web_contents),
|
| + web_contents_(web_contents),
|
| + enable_chrome_style_(enable_chrome_style),
|
| + custom_client_insets_(true),
|
| + client_insets_(client_insets) {
|
| + InitConstrainedWindowViews(widget_delegate);
|
| +}
|
| +
|
| +void ConstrainedWindowViews::InitConstrainedWindowViews(
|
| + views::WidgetDelegate* widget_delegate) {
|
| + native_constrained_window_ =
|
| + NativeConstrainedWindow::CreateNativeConstrainedWindow(this);
|
| views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
|
| params.delegate = widget_delegate;
|
| params.native_widget = native_constrained_window_->AsNativeWidget();
|
| @@ -594,9 +613,9 @@ ConstrainedWindowViews::ConstrainedWindowViews(
|
|
|
| if (enable_chrome_style_) {
|
| params.parent_widget = Widget::GetTopLevelWidgetForNativeView(
|
| - web_contents->GetView()->GetNativeView());
|
| + web_contents_->GetView()->GetNativeView());
|
| } else {
|
| - params.parent = web_contents->GetNativeView();
|
| + params.parent = web_contents_->GetNativeView();
|
| }
|
|
|
| #if defined(USE_ASH)
|
| @@ -695,7 +714,16 @@ void ConstrainedWindowViews::CenterWindow(const gfx::Size& size) {
|
|
|
| views::NonClientFrameView* ConstrainedWindowViews::CreateNonClientFrameView() {
|
| if (enable_chrome_style_) {
|
| - return new ConstrainedWindowFrameSimple(this);
|
| + ConstrainedWindowFrameSimple* frame =
|
| + new ConstrainedWindowFrameSimple(this);
|
| + if (custom_client_insets_) {
|
| + frame->set_border(views::Border::CreateEmptyBorder(
|
| + client_insets_.top(),
|
| + client_insets_.left(),
|
| + client_insets_.bottom(),
|
| + client_insets_.right()));
|
| + }
|
| + return frame;
|
| } else {
|
| #if defined(USE_ASH)
|
| CommandLine* command_line = CommandLine::ForCurrentProcess();
|
|
|