Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: chrome/app/android/chrome_main_delegate_android.cc

Issue 10918113: Add initial Chromium TestShell support for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove commented out lines. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/android/chrome_main_delegate_android.h ('k') | chrome/app/chrome_main_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 "chrome/app/android/chrome_main_delegate_android.h"
6
7 #include "base/android/jni_android.h"
8 #include "base/command_line.h"
9 #include "base/logging.h"
10 #include "chrome/browser/android/chrome_jni_registrar.h"
11 #include "chrome/browser/android/chrome_startup_flags.h"
12 #include "chrome/common/chrome_switches.h"
13 #include "content/public/browser/browser_main_runner.h"
14
15 // ChromeMainDelegateAndroid is created when the library is loaded. It is always
16 // done in the process's main Java thread. But for non browser process, e.g.
17 // renderer process, it is not the native Chrome's main thread.
18 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() {
19 }
20
21 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() {
22 }
23
24 void ChromeMainDelegateAndroid::SandboxInitialized(
25 const std::string& process_type) {
26 ChromeMainDelegate::SandboxInitialized(process_type);
27 }
28
29 int ChromeMainDelegateAndroid::RunProcess(
30 const std::string& process_type,
31 const content::MainFunctionParams& main_function_params) {
32 if (process_type.empty()) {
33 JNIEnv* env = base::android::AttachCurrentThread();
34 RegisterApplicationNativeMethods(env);
35
36 browser_runner_.reset(content::BrowserMainRunner::Create());
37 int exit_code = browser_runner_->Initialize(main_function_params);
38 DCHECK(exit_code < 0);
39
40 // Return 0 so that we do NOT trigger the default behavior. On Android, the
41 // UI message loop is managed by the Java application.
42 return 0;
43 }
44
45 return ChromeMainDelegate::RunProcess(process_type, main_function_params);
46 }
47
48 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) {
49 SetChromeSpecificCommandLineFlags();
50 return ChromeMainDelegate::BasicStartupComplete(exit_code);
51 }
52
53 bool ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(JNIEnv* env) {
54 return chrome::android::RegisterJni(env);
55 }
OLDNEW
« no previous file with comments | « chrome/app/android/chrome_main_delegate_android.h ('k') | chrome/app/chrome_main_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698