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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 #if defined(OS_CHROMEOS) | 489 #if defined(OS_CHROMEOS) |
490 window_widget_ = views::Widget::CreateWindowWithContextAndBounds( | 490 window_widget_ = views::Widget::CreateWindowWithContextAndBounds( |
491 new ShellWindowDelegateView(this), | 491 new ShellWindowDelegateView(this), |
492 wm_test_helper_->GetDefaultParent(NULL, NULL, gfx::Rect()), | 492 wm_test_helper_->GetDefaultParent(NULL, NULL, gfx::Rect()), |
493 gfx::Rect(0, 0, width, height)); | 493 gfx::Rect(0, 0, width, height)); |
494 #else | 494 #else |
495 window_widget_ = new views::Widget; | 495 window_widget_ = new views::Widget; |
496 views::Widget::InitParams params; | 496 views::Widget::InitParams params; |
497 params.bounds = gfx::Rect(0, 0, width, height); | 497 params.bounds = gfx::Rect(0, 0, width, height); |
498 params.delegate = new ShellWindowDelegateView(this); | 498 params.delegate = new ShellWindowDelegateView(this); |
499 params.top_level = true; | |
500 params.remove_standard_frame = true; | 499 params.remove_standard_frame = true; |
501 window_widget_->Init(params); | 500 window_widget_->Init(params); |
502 #endif | 501 #endif |
503 | 502 |
504 content_size_ = gfx::Size(width, height); | 503 content_size_ = gfx::Size(width, height); |
505 | 504 |
506 window_ = window_widget_->GetNativeWindow(); | 505 window_ = window_widget_->GetNativeWindow(); |
507 // Call ShowRootWindow on RootWindow created by WMTestHelper without | 506 // Call ShowRootWindow on RootWindow created by WMTestHelper without |
508 // which XWindow owned by RootWindow doesn't get mapped. | 507 // which XWindow owned by RootWindow doesn't get mapped. |
509 window_->GetHost()->Show(); | 508 window_->GetHost()->Show(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 561 |
563 void Shell::PlatformWebContentsFocused(WebContents* contents) { | 562 void Shell::PlatformWebContentsFocused(WebContents* contents) { |
564 if (headless_) | 563 if (headless_) |
565 return; | 564 return; |
566 ShellWindowDelegateView* delegate_view = | 565 ShellWindowDelegateView* delegate_view = |
567 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 566 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
568 delegate_view->OnWebContentsFocused(contents); | 567 delegate_view->OnWebContentsFocused(contents); |
569 } | 568 } |
570 | 569 |
571 } // namespace content | 570 } // namespace content |
OLD | NEW |