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 "chrome/browser/chrome_browser_main_android.h" | |
6 | |
7 #include "base/android/jni_android.h" | |
8 #include "chrome/browser/android/android_protocol_adapter.h" | |
9 #include "chrome/browser/android/chrome_jni_registrar.h" | |
10 #include "chrome/common/chrome_switches.h" | |
11 #include "content/public/common/main_function_params.h" | |
12 #include "net/android/network_change_notifier_factory.h" | |
13 #include "net/base/network_change_notifier.h" | |
14 | |
15 ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( | |
16 const content::MainFunctionParams& parameters) | |
17 : ChromeBrowserMainParts(parameters) { | |
18 } | |
19 | |
20 ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { | |
21 } | |
22 | |
23 void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { | |
24 JNIEnv* env = base::android::AttachCurrentThread(); | |
25 DCHECK(env); | |
26 | |
27 chrome::android::RegisterJni(env); | |
28 | |
29 AndroidProtocolAdapter::RegisterProtocols(env); | |
30 | |
31 // Support gcov code coverage. In order for gcov to work, we need to | |
32 // explicilty export GCOV_PREFIX to the environment. | |
33 if (parsed_command_line().HasSwitch(switches::kGcovPrefix)) { | |
34 const std::string gcov_prefix = | |
35 parsed_command_line().GetSwitchValueASCII(switches::kGcovPrefix); | |
36 setenv("GCOV_PREFIX", gcov_prefix.c_str(), 1); | |
37 } | |
38 if (parsed_command_line().HasSwitch(switches::kGcovPrefixStrip)) { | |
39 const std::string gcov_prefix_strip = | |
40 parsed_command_line().GetSwitchValueASCII(switches::kGcovPrefixStrip); | |
41 setenv("GCOV_PREFIX", gcov_prefix_strip.c_str(), 1); | |
42 } | |
43 | |
44 net::NetworkChangeNotifier::SetFactory( | |
45 new net::android::NetworkChangeNotifierFactory()); | |
46 | |
47 DCHECK(!main_message_loop_.get()); | |
48 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); | |
49 MessageLoopForUI::current()->Start(); | |
50 | |
51 ChromeBrowserMainParts::PreEarlyInitialization(); | |
52 } | |
53 | |
54 void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { | |
55 VLOG(0) << "ShowMissingLocaleMessageBox"; | |
56 } | |
57 | |
58 void RecordBreakpadStatusUMA(MetricsService* metrics) { | |
59 // Not implemented for now. | |
Nico
2012/07/25 19:50:16
Do you plan to implement this eventually?
aurimas (slooooooooow)
2012/07/25 22:05:46
Done.
| |
60 } | |
61 | |
62 void WarnAboutMinimumSystemRequirements() { | |
63 // Nothing to warn right now. | |
64 } | |
OLD | NEW |