Index: chrome/browser/chrome_browser_main_android.cc |
diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b0276a7c2b6b080031ed108e5c9eeeb8b0bcb13f |
--- /dev/null |
+++ b/chrome/browser/chrome_browser_main_android.cc |
@@ -0,0 +1,61 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/chrome_browser_main_android.h" |
+ |
+#include "base/android/jni_android.h" |
+#include "chrome/browser/android/chrome_jni_registrar.h" |
+#include "chrome/common/chrome_switches.h" |
+#include "content/public/common/main_function_params.h" |
+#include "net/android/network_change_notifier_factory.h" |
+#include "net/base/network_change_notifier.h" |
+ |
+ChromeBrowserMainPartsAndroid::ChromeBrowserMainPartsAndroid( |
+ const content::MainFunctionParams& parameters) |
+ : ChromeBrowserMainParts(parameters) { |
+} |
+ |
+ChromeBrowserMainPartsAndroid::~ChromeBrowserMainPartsAndroid() { |
+} |
+ |
+void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { |
+ JNIEnv* env = base::android::AttachCurrentThread(); |
+ DCHECK(env); |
+ |
+ chrome::android::RegisterJni(env); |
+ |
+ // Support gcov code coverage. In order for gcov to work, we need to |
+ // explicilty export GCOV_PREFIX to the environment. |
+ if (parsed_command_line().HasSwitch(switches::kGcovPrefix)) { |
+ const std::string gcov_prefix = |
Nico
2012/07/25 19:50:16
std::string&
aurimas (slooooooooow)
2012/07/25 22:05:46
Done.
|
+ parsed_command_line().GetSwitchValueASCII(switches::kGcovPrefix); |
+ setenv("GCOV_PREFIX", gcov_prefix.c_str(), 1); |
+ } |
+ if (parsed_command_line().HasSwitch(switches::kGcovPrefixStrip)) { |
Nico
2012/07/25 19:50:16
This looks identical to the previous if. Do you ne
aurimas (slooooooooow)
2012/07/25 22:05:46
Completely removing GCOV as it is not actually bei
|
+ const std::string gcov_prefix_strip = |
+ parsed_command_line().GetSwitchValueASCII(switches::kGcovPrefixStrip); |
+ setenv("GCOV_PREFIX", gcov_prefix_strip.c_str(), 1); |
+ } |
+ |
+ net::NetworkChangeNotifier::SetFactory( |
+ new net::android::NetworkChangeNotifierFactory()); |
+ |
+ DCHECK(!main_message_loop_.get()); |
+ main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); |
+ MessageLoopForUI::current()->Start(); |
Nico
2012/07/25 19:50:16
content/shell/shell_browser_main_parts.cc does thi
aurimas (slooooooooow)
2012/07/25 22:05:46
Done.
|
+ |
+ ChromeBrowserMainParts::PreEarlyInitialization(); |
+} |
+ |
+void ChromeBrowserMainPartsAndroid::ShowMissingLocaleMessageBox() { |
+ VLOG(0) << "ShowMissingLocaleMessageBox"; |
Nico
2012/07/25 19:50:16
Shoudl this be NOTREACHED() instead?
aurimas (slooooooooow)
2012/07/25 22:05:46
Done.
|
+} |
+ |
+void RecordBreakpadStatusUMA(MetricsService* metrics) { |
+ // Not implemented for now. |
Nico
2012/07/25 19:50:16
If you intend to implement this, file a tracking b
aurimas (slooooooooow)
2012/07/25 22:05:46
Done.
|
+} |
+ |
+void WarnAboutMinimumSystemRequirements() { |
+ // Nothing to warn right now. |
Nico
2012/07/25 19:50:16
Remove comment.
aurimas (slooooooooow)
2012/07/25 22:05:46
Done.
|
+} |