| 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 "chromecast/service/cast_service_simple.h" | 5 #include "chromecast/service/cast_service_simple.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // Add and show content's view/window | 108 // Add and show content's view/window |
| 109 aura::Window* content_window = web_contents_->GetNativeView(); | 109 aura::Window* content_window = web_contents_->GetNativeView(); |
| 110 aura::Window* parent = window_tree_host_->window(); | 110 aura::Window* parent = window_tree_host_->window(); |
| 111 if (!parent->Contains(content_window)) { | 111 if (!parent->Contains(content_window)) { |
| 112 parent->AddChild(content_window); | 112 parent->AddChild(content_window); |
| 113 } | 113 } |
| 114 content_window->Show(); | 114 content_window->Show(); |
| 115 | 115 |
| 116 web_contents_->GetController().LoadURL(GetStartupURL(), | 116 web_contents_->GetController().LoadURL(GetStartupURL(), |
| 117 content::Referrer(), | 117 content::Referrer(), |
| 118 content::PAGE_TRANSITION_TYPED, | 118 ui::PAGE_TRANSITION_TYPED, |
| 119 std::string()); | 119 std::string()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void CastServiceSimple::StopInternal() { | 122 void CastServiceSimple::StopInternal() { |
| 123 web_contents_->GetRenderViewHost()->ClosePage(); | 123 web_contents_->GetRenderViewHost()->ClosePage(); |
| 124 window_tree_host_.reset(); | 124 window_tree_host_.reset(); |
| 125 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); | 125 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, NULL); |
| 126 aura::Env::DeleteInstance(); | 126 aura::Env::DeleteInstance(); |
| 127 web_contents_.reset(); | 127 web_contents_.reset(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace chromecast | 130 } // namespace chromecast |
| OLD | NEW |