Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / android / chrome_startup_flags.cc
blob4f33191fb3a8efebed5a819ab5d2cb184f904e8e
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.
5 #include <jni.h>
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/android/sys_utils.h"
13 #include "base/command_line.h"
14 #include "base/logging.h"
15 #include "chrome/common/chrome_switches.h"
16 #include "content/public/common/content_switches.h"
17 #include "media/base/media_switches.h"
19 namespace {
21 void SetCommandLineSwitch(const std::string& switch_string) {
22 CommandLine* command_line = CommandLine::ForCurrentProcess();
23 if (!command_line->HasSwitch(switch_string))
24 command_line->AppendSwitch(switch_string);
27 void SetCommandLineSwitchASCII(const std::string& switch_string,
28 const std::string& value) {
29 CommandLine* command_line = CommandLine::ForCurrentProcess();
30 if (!command_line->HasSwitch(switch_string))
31 command_line->AppendSwitchASCII(switch_string, value);
34 } // namespace
36 void SetChromeSpecificCommandLineFlags() {
37 // Turn on autologin.
38 SetCommandLineSwitch(switches::kEnableAutologin);
40 // Enable prerender for the omnibox.
41 SetCommandLineSwitchASCII(
42 switches::kPrerenderMode, switches::kPrerenderModeSwitchValueEnabled);
43 SetCommandLineSwitchASCII(
44 switches::kPrerenderFromOmnibox,
45 switches::kPrerenderFromOmniboxSwitchValueEnabled);
46 if (base::android::SysUtils::IsLowEndDevice())
47 SetCommandLineSwitch(switches::kDisableSyncFavicons);