| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/public/browser/render_widget_host_view.h" | 9 #include "content/public/browser/render_widget_host_view.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 content_size_ = gfx::Size(width, height); | 480 content_size_ = gfx::Size(width, height); |
| 481 if (!platform_) | 481 if (!platform_) |
| 482 platform_ = new ShellPlatformDataAura(content_size_); | 482 platform_ = new ShellPlatformDataAura(content_size_); |
| 483 else | 483 else |
| 484 platform_->ResizeWindow(content_size_); | 484 platform_->ResizeWindow(content_size_); |
| 485 return; | 485 return; |
| 486 } | 486 } |
| 487 #if defined(OS_CHROMEOS) | 487 #if defined(OS_CHROMEOS) |
| 488 window_widget_ = views::Widget::CreateWindowWithContextAndBounds( | 488 window_widget_ = views::Widget::CreateWindowWithContextAndBounds( |
| 489 new ShellWindowDelegateView(this), | 489 new ShellWindowDelegateView(this), |
| 490 wm_test_helper_->root_window(), | 490 wm_test_helper_->GetDefaultParent(NULL, NULL, gfx::Rect()), |
| 491 gfx::Rect(0, 0, width, height)); | 491 gfx::Rect(0, 0, width, height)); |
| 492 #else | 492 #else |
| 493 window_widget_ = new views::Widget; | 493 window_widget_ = new views::Widget; |
| 494 views::Widget::InitParams params; | 494 views::Widget::InitParams params; |
| 495 params.bounds = gfx::Rect(0, 0, width, height); | 495 params.bounds = gfx::Rect(0, 0, width, height); |
| 496 params.delegate = new ShellWindowDelegateView(this); | 496 params.delegate = new ShellWindowDelegateView(this); |
| 497 params.top_level = true; | 497 params.top_level = true; |
| 498 params.remove_standard_frame = true; | 498 params.remove_standard_frame = true; |
| 499 window_widget_->Init(params); | 499 window_widget_->Init(params); |
| 500 #endif | 500 #endif |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 void Shell::PlatformWebContentsFocused(WebContents* contents) { | 561 void Shell::PlatformWebContentsFocused(WebContents* contents) { |
| 562 if (headless_) | 562 if (headless_) |
| 563 return; | 563 return; |
| 564 ShellWindowDelegateView* delegate_view = | 564 ShellWindowDelegateView* delegate_view = |
| 565 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 565 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
| 566 delegate_view->OnWebContentsFocused(contents); | 566 delegate_view->OnWebContentsFocused(contents); |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace content | 569 } // namespace content |
| OLD | NEW |