| 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 // Call ShowRootWindow on RootWindow created by WMTestHelper without | 505 // Call ShowRootWindow on RootWindow created by WMTestHelper without |
| 506 // which XWindow owned by RootWindow doesn't get mapped. | 506 // which XWindow owned by RootWindow doesn't get mapped. |
| 507 window_->GetHost()->Show(); | 507 window_->GetHost()->Show(); |
| 508 window_widget_->Show(); | 508 window_widget_->Show(); |
| 509 } | 509 } |
| 510 | 510 |
| 511 void Shell::PlatformSetContents() { | 511 void Shell::PlatformSetContents() { |
| 512 if (headless_) { | 512 if (headless_) { |
| 513 CHECK(platform_); | 513 CHECK(platform_); |
| 514 aura::Window* content = web_contents_->GetView()->GetNativeView(); | 514 aura::Window* content = web_contents_->GetView()->GetNativeView(); |
| 515 aura::Window* parent = platform_->dispatcher()->window(); | 515 aura::Window* parent = platform_->host()->window(); |
| 516 if (!parent->Contains(content)) { | 516 if (!parent->Contains(content)) { |
| 517 parent->AddChild(content); | 517 parent->AddChild(content); |
| 518 content->Show(); | 518 content->Show(); |
| 519 } | 519 } |
| 520 content->SetBounds(gfx::Rect(content_size_)); | 520 content->SetBounds(gfx::Rect(content_size_)); |
| 521 RenderWidgetHostView* host_view = web_contents_->GetRenderWidgetHostView(); | 521 RenderWidgetHostView* host_view = web_contents_->GetRenderWidgetHostView(); |
| 522 if (host_view) | 522 if (host_view) |
| 523 host_view->SetSize(content_size_); | 523 host_view->SetSize(content_size_); |
| 524 } else { | 524 } else { |
| 525 views::WidgetDelegate* widget_delegate = window_widget_->widget_delegate(); | 525 views::WidgetDelegate* widget_delegate = window_widget_->widget_delegate(); |
| (...skipping 34 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 |