| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 290 |
| 291 void NativeAppWindowViews::ViewHierarchyChanged( | 291 void NativeAppWindowViews::ViewHierarchyChanged( |
| 292 const ViewHierarchyChangedDetails& details) { | 292 const ViewHierarchyChangedDetails& details) { |
| 293 if (details.is_add && details.child == this) { | 293 if (details.is_add && details.child == this) { |
| 294 web_view_ = new views::WebView(NULL); | 294 web_view_ = new views::WebView(NULL); |
| 295 AddChildView(web_view_); | 295 AddChildView(web_view_); |
| 296 web_view_->SetWebContents(app_window_->web_contents()); | 296 web_view_->SetWebContents(app_window_->web_contents()); |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 | 299 |
| 300 gfx::Size NativeAppWindowViews::GetMinimumSize() { | 300 gfx::Size NativeAppWindowViews::GetMinimumSize() const { |
| 301 return size_constraints_.GetMinimumSize(); | 301 return size_constraints_.GetMinimumSize(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 gfx::Size NativeAppWindowViews::GetMaximumSize() { | 304 gfx::Size NativeAppWindowViews::GetMaximumSize() { |
| 305 return size_constraints_.GetMaximumSize(); | 305 return size_constraints_.GetMaximumSize(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void NativeAppWindowViews::OnFocus() { | 308 void NativeAppWindowViews::OnFocus() { |
| 309 web_view_->RequestFocus(); | 309 web_view_->RequestFocus(); |
| 310 } | 310 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 return size_constraints_.GetMaximumSize(); | 399 return size_constraints_.GetMaximumSize(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 void NativeAppWindowViews::SetContentSizeConstraints( | 402 void NativeAppWindowViews::SetContentSizeConstraints( |
| 403 const gfx::Size& min_size, const gfx::Size& max_size) { | 403 const gfx::Size& min_size, const gfx::Size& max_size) { |
| 404 size_constraints_.set_minimum_size(min_size); | 404 size_constraints_.set_minimum_size(min_size); |
| 405 size_constraints_.set_maximum_size(max_size); | 405 size_constraints_.set_maximum_size(max_size); |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namespace apps | 408 } // namespace apps |
| OLD | NEW |