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/browser/android/cast_window_android.h" | 5 #include "chromecast/browser/android/cast_window_android.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "chromecast/browser/android/cast_window_manager.h" | 9 #include "chromecast/browser/android/cast_window_manager.h" |
10 #include "chromecast/browser/cast_content_window.h" | 10 #include "chromecast/browser/cast_content_window.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 // The time (in milliseconds) we wait for after a page is closed (i.e. | 27 // The time (in milliseconds) we wait for after a page is closed (i.e. |
28 // after an app is stopped) before we delete the corresponding WebContents. | 28 // after an app is stopped) before we delete the corresponding WebContents. |
29 const int kWebContentsDestructionDelayInMs = 50; | 29 const int kWebContentsDestructionDelayInMs = 50; |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 // static | 33 // static |
34 bool CastWindowAndroid::RegisterJni(JNIEnv* env) { | |
35 return RegisterNativesImpl(env); | |
36 } | |
37 | |
38 // static | |
39 CastWindowAndroid* CastWindowAndroid::CreateNewWindow( | 34 CastWindowAndroid* CastWindowAndroid::CreateNewWindow( |
40 content::BrowserContext* browser_context, | 35 content::BrowserContext* browser_context, |
41 const GURL& url) { | 36 const GURL& url) { |
42 CastWindowAndroid* window_android = new CastWindowAndroid(browser_context); | 37 CastWindowAndroid* window_android = new CastWindowAndroid(browser_context); |
43 window_android->Initialize(); | 38 window_android->Initialize(); |
44 | 39 |
45 if (!url.is_empty()) | 40 if (!url.is_empty()) |
46 window_android->LoadURL(url); | 41 window_android->LoadURL(url); |
47 | 42 |
48 content::RenderWidgetHostView* rwhv = | 43 content::RenderWidgetHostView* rwhv = |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 contents->GetRenderViewHost()->GetWidget()->Focus(); | 144 contents->GetRenderViewHost()->GetWidget()->Focus(); |
150 } | 145 } |
151 | 146 |
152 void CastWindowAndroid::RenderProcessGone(base::TerminationStatus status) { | 147 void CastWindowAndroid::RenderProcessGone(base::TerminationStatus status) { |
153 LOG(ERROR) << "Render process gone: status=" << status; | 148 LOG(ERROR) << "Render process gone: status=" << status; |
154 Destroy(); | 149 Destroy(); |
155 } | 150 } |
156 | 151 |
157 } // namespace shell | 152 } // namespace shell |
158 } // namespace chromecast | 153 } // namespace chromecast |
OLD | NEW |