| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/ui/views/native_app_window_views.h" | 5 #include "apps/ui/views/native_app_window_views.h" |
| 6 | 6 |
| 7 #include "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 NativeAppWindowViews::~NativeAppWindowViews() { | 52 NativeAppWindowViews::~NativeAppWindowViews() { |
| 53 web_view_->SetWebContents(NULL); | 53 web_view_->SetWebContents(NULL); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void NativeAppWindowViews::InitializeWindow( | 56 void NativeAppWindowViews::InitializeWindow( |
| 57 AppWindow* app_window, | 57 AppWindow* app_window, |
| 58 const AppWindow::CreateParams& create_params) { | 58 const AppWindow::CreateParams& create_params) { |
| 59 // Stub implementation. See also ChromeNativeAppWindowViews. | 59 // Stub implementation. See also ChromeNativeAppWindowViews. |
| 60 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); | 60 views::Widget::InitParams init_params(views::Widget::InitParams::TYPE_WINDOW); |
| 61 init_params.delegate = this; | 61 init_params.delegate = this; |
| 62 init_params.top_level = true; | |
| 63 init_params.keep_on_top = create_params.always_on_top; | 62 init_params.keep_on_top = create_params.always_on_top; |
| 64 widget_->Init(init_params); | 63 widget_->Init(init_params); |
| 65 widget_->CenterWindow( | 64 widget_->CenterWindow( |
| 66 create_params.GetInitialWindowBounds(gfx::Insets()).size()); | 65 create_params.GetInitialWindowBounds(gfx::Insets()).size()); |
| 67 } | 66 } |
| 68 | 67 |
| 69 // ui::BaseWindow implementation. | 68 // ui::BaseWindow implementation. |
| 70 | 69 |
| 71 bool NativeAppWindowViews::IsActive() const { return widget_->IsActive(); } | 70 bool NativeAppWindowViews::IsActive() const { return widget_->IsActive(); } |
| 72 | 71 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 return size_constraints_.GetMaximumSize(); | 392 return size_constraints_.GetMaximumSize(); |
| 394 } | 393 } |
| 395 | 394 |
| 396 void NativeAppWindowViews::SetContentSizeConstraints( | 395 void NativeAppWindowViews::SetContentSizeConstraints( |
| 397 const gfx::Size& min_size, const gfx::Size& max_size) { | 396 const gfx::Size& min_size, const gfx::Size& max_size) { |
| 398 size_constraints_.set_minimum_size(min_size); | 397 size_constraints_.set_minimum_size(min_size); |
| 399 size_constraints_.set_maximum_size(max_size); | 398 size_constraints_.set_maximum_size(max_size); |
| 400 } | 399 } |
| 401 | 400 |
| 402 } // namespace apps | 401 } // namespace apps |
| OLD | NEW |