chrome_startup_flags.cc revision 7d4cd473f85ac64c3747c96c277f9e506a0d2246
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 <jni.h> 6 7#include "chrome/browser/android/chrome_startup_flags.h" 8 9#include "base/android/jni_android.h" 10#include "base/android/jni_string.h" 11#include "base/android/scoped_java_ref.h" 12#include "base/command_line.h" 13#include "base/logging.h" 14#include "chrome/common/chrome_switches.h" 15#include "content/public/common/content_switches.h" 16#include "media/base/media_switches.h" 17 18namespace { 19 20void SetCommandLineSwitch(const std::string& switch_string) { 21 CommandLine* command_line = CommandLine::ForCurrentProcess(); 22 if (!command_line->HasSwitch(switch_string)) 23 command_line->AppendSwitch(switch_string); 24} 25 26void SetCommandLineSwitchASCII(const std::string& switch_string, 27 const std::string& value) { 28 CommandLine* command_line = CommandLine::ForCurrentProcess(); 29 if (!command_line->HasSwitch(switch_string)) 30 command_line->AppendSwitchASCII(switch_string, value); 31} 32 33} // namespace 34 35void SetChromeSpecificCommandLineFlags() { 36 // Turn on autologin. 37 SetCommandLineSwitch(switches::kEnableAutologin); 38 39 // Use ClientLogin token on android. 40 // TODO(pavely): Remove once sync on android uses oauth2 tokens. 41 SetCommandLineSwitch(switches::kSyncDisableOAuth2Token); 42 43 // Enable prerender for the omnibox. 44 SetCommandLineSwitchASCII( 45 switches::kPrerenderMode, switches::kPrerenderModeSwitchValueEnabled); 46 SetCommandLineSwitchASCII( 47 switches::kPrerenderFromOmnibox, 48 switches::kPrerenderFromOmniboxSwitchValueEnabled); 49#if defined(GOOGLE_TV) 50 SetCommandLineSwitch(switches::kPpapiInProcess); 51#endif 52} 53