- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / android / testshell / chrome_main_delegate_testshell_android.cc
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/android/testshell/chrome_main_delegate_testshell_android.h"
6
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h"
9 #include "chrome/android/testshell/testshell_tab.h"
10 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
11
12 static const char kDefaultCountryCode[] = "US";
13
14 static base::android::RegistrationMethod kRegistrationMethods[] = {
15     { "TestShellTab", TestShellTab::RegisterTestShellTab },
16 };
17
18 ChromeMainDelegateAndroid* ChromeMainDelegateAndroid::Create() {
19   return new ChromeMainDelegateTestShellAndroid();
20 }
21
22 ChromeMainDelegateTestShellAndroid::ChromeMainDelegateTestShellAndroid() {
23 }
24
25 ChromeMainDelegateTestShellAndroid::~ChromeMainDelegateTestShellAndroid() {
26 }
27
28 bool ChromeMainDelegateTestShellAndroid::BasicStartupComplete(int* exit_code) {
29   TemplateURLPrepopulateData::InitCountryCode(kDefaultCountryCode);
30   return ChromeMainDelegateAndroid::BasicStartupComplete(exit_code);
31 }
32
33 bool ChromeMainDelegateTestShellAndroid::RegisterApplicationNativeMethods(
34     JNIEnv* env) {
35   return ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(env) &&
36       base::android::RegisterNativeMethods(env,
37                                            kRegistrationMethods,
38                                            arraysize(kRegistrationMethods));
39 }