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.
7 #include "chrome/browser/android/chrome_startup_flags.h"
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 "media/base/media_switches.h"
19 void SetCommandLineSwitch(const std::string
& switch_string
) {
20 CommandLine
* command_line
= CommandLine::ForCurrentProcess();
21 if (!command_line
->HasSwitch(switch_string
))
22 command_line
->AppendSwitch(switch_string
);
25 void SetCommandLineSwitchASCII(const std::string
& switch_string
,
26 const std::string
& value
) {
27 CommandLine
* command_line
= CommandLine::ForCurrentProcess();
28 if (!command_line
->HasSwitch(switch_string
))
29 command_line
->AppendSwitchASCII(switch_string
, value
);
34 void SetChromeSpecificCommandLineFlags() {
36 SetCommandLineSwitch(switches::kEnableAutologin
);
38 // Turn on query extraction on omnibox searches.
39 SetCommandLineSwitch(switches::kEnableInstantExtendedAPI
);
41 // Enable prerender for the omnibox.
42 SetCommandLineSwitchASCII(
43 switches::kPrerenderMode
, switches::kPrerenderModeSwitchValueEnabled
);
44 SetCommandLineSwitchASCII(
45 switches::kPrerenderFromOmnibox
,
46 switches::kPrerenderFromOmniboxSwitchValueEnabled
);
47 #if !defined(GOOGLE_TV)
48 SetCommandLineSwitch(switches::kDisableEncryptedMedia
);