OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/chrome_browser_main_android.h" | 5 #include "chrome/browser/chrome_browser_main_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | |
8 #include "chrome/browser/android/chrome_jni_registrar.h" | |
9 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
10 #include "content/public/common/main_function_params.h" | 8 #include "content/public/common/main_function_params.h" |
11 #include "net/android/network_change_notifier_factory.h" | 9 #include "net/android/network_change_notifier_factory.h" |
12 #include "net/base/network_change_notifier.h" | 10 #include "net/base/network_change_notifier.h" |
13 | 11 |
14 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( | 12 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( |
15 const content::MainFunctionParams& parameters) | 13 const content::MainFunctionParams& parameters) |
16 : ChromeBrowserMainParts(parameters) { | 14 : ChromeBrowserMainParts(parameters) { |
17 } | 15 } |
18 | 16 |
19 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { | 17 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { |
20 } | 18 } |
21 | 19 |
22 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { | 20 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { |
23 JNIEnv* env = base::android::AttachCurrentThread(); | |
24 DCHECK(env); | |
25 | |
26 chrome::android::RegisterJni(env); | |
27 | |
28 net::NetworkChangeNotifier::SetFactory( | 21 net::NetworkChangeNotifier::SetFactory( |
29 new net::android::NetworkChangeNotifierFactory()); | 22 new net::android::NetworkChangeNotifierFactory()); |
30 | 23 |
31 // Chrome on Android does not use default MessageLoop. It has its own | 24 // Chrome on Android does not use default MessageLoop. It has its own |
32 // Android specific MessageLoop. | 25 // Android specific MessageLoop. |
33 DCHECK(!main_message_loop_.get()); | 26 DCHECK(!main_message_loop_.get()); |
34 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | 27 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
35 MessageLoopForUI::current()->Start(); | 28 MessageLoopForUI::current()->Start(); |
36 | 29 |
37 ChromeBrowserMainParts::PreEarlyInitialization(); | 30 ChromeBrowserMainParts::PreEarlyInitialization(); |
38 } | 31 } |
39 | 32 |
40 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { | 33 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { |
41 NOTREACHED(); | 34 NOTREACHED(); |
42 } | 35 } |
43 | 36 |
44 void RecordBreakpadStatusUMA(MetricsService* metrics) { | 37 void RecordBreakpadStatusUMA(MetricsService* metrics) { |
45 // TODO: crbug.com/139023 | 38 // TODO: crbug.com/139023 |
46 NOTIMPLEMENTED(); | 39 NOTIMPLEMENTED(); |
47 } | 40 } |
48 | 41 |
49 void WarnAboutMinimumSystemRequirements() { | 42 void WarnAboutMinimumSystemRequirements() { |
50 } | 43 } |
OLD | NEW |