OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "android_webview/lib/main/webview_main_delegate.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "content/public/browser/browser_main_runner.h" |
| 9 |
| 10 namespace android_webview { |
| 11 |
| 12 WebViewMainDelegate::WebViewMainDelegate() { |
| 13 } |
| 14 |
| 15 WebViewMainDelegate::~WebViewMainDelegate() { |
| 16 } |
| 17 |
| 18 int WebViewMainDelegate::RunProcess( |
| 19 const std::string& process_type, |
| 20 const content::MainFunctionParams& main_function_params) { |
| 21 if (process_type.empty()) { |
| 22 browser_runner_.reset(content::BrowserMainRunner::Create()); |
| 23 int exit_code = browser_runner_->Initialize(main_function_params); |
| 24 DCHECK(exit_code < 0); |
| 25 |
| 26 // Return 0 so that we do NOT trigger the default behavior. On Android, the |
| 27 // UI message loop is managed by the Java application. |
| 28 return 0; |
| 29 } |
| 30 |
| 31 // Android doesn't currently support/need any other process types handled by |
| 32 // ChromeMainDelegate, so we simply return -1 here rather than calling the |
| 33 // superclass implementation. |
| 34 return -1; |
| 35 } |
| 36 |
| 37 } // namespace android_webview |
OLD | NEW |