chrome_startup_flags.cc revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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 "media/base/media_switches.h"
16
17namespace {
18
19void 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);
23}
24
25void 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);
30}
31
32}  // namespace
33
34void SetChromeSpecificCommandLineFlags() {
35  // Turn on autologin.
36  SetCommandLineSwitch(switches::kEnableAutologin);
37
38  // Turn on query extraction on omnibox searches.
39  SetCommandLineSwitch(switches::kEnableInstantExtendedAPI);
40
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);
49#endif
50}
51