OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <jni.h> | 5 #include <jni.h> |
6 | 6 |
7 #include "chrome/browser/android/chrome_startup_flags.h" | 7 #include "chrome/browser/android/chrome_startup_flags.h" |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 void SetCommandLineSwitchASCII(const std::string& switch_string, | 28 void SetCommandLineSwitchASCII(const std::string& switch_string, |
29 const std::string& value) { | 29 const std::string& value) { |
30 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 30 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
31 if (!command_line->HasSwitch(switch_string)) | 31 if (!command_line->HasSwitch(switch_string)) |
32 command_line->AppendSwitchASCII(switch_string, value); | 32 command_line->AppendSwitchASCII(switch_string, value); |
33 } | 33 } |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 void SetChromeSpecificCommandLineFlags() { | 37 void SetChromeSpecificCommandLineFlags() { |
| 38 // Enable prerender with holdback. |
| 39 SetCommandLineSwitchASCII(switches::kPrerenderMode, |
| 40 switches::kPrerenderModeSwitchValueAuto); |
| 41 |
38 // Enable prerender for the omnibox. | 42 // Enable prerender for the omnibox. |
39 SetCommandLineSwitchASCII(switches::kPrerenderMode, | |
40 switches::kPrerenderModeSwitchValueEnabled); | |
41 SetCommandLineSwitchASCII(switches::kPrerenderFromOmnibox, | 43 SetCommandLineSwitchASCII(switches::kPrerenderFromOmnibox, |
42 switches::kPrerenderFromOmniboxSwitchValueEnabled); | 44 switches::kPrerenderFromOmniboxSwitchValueEnabled); |
43 | 45 |
44 // Disable syncing favicons on low end devices. | 46 // Disable syncing favicons on low end devices. |
45 if (base::android::SysUtils::IsLowEndDevice()) | 47 if (base::android::SysUtils::IsLowEndDevice()) |
46 SetCommandLineSwitchASCII(switches::kDisableSyncTypes, "Favicon Images"); | 48 SetCommandLineSwitchASCII(switches::kDisableSyncTypes, "Favicon Images"); |
47 | 49 |
48 // Enable DOM Distiller on local builds, canary and dev-channel. | 50 // Enable DOM Distiller on local builds, canary and dev-channel. |
49 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 51 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
50 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN || | 52 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN || |
51 channel == chrome::VersionInfo::CHANNEL_CANARY || | 53 channel == chrome::VersionInfo::CHANNEL_CANARY || |
52 channel == chrome::VersionInfo::CHANNEL_DEV) { | 54 channel == chrome::VersionInfo::CHANNEL_DEV) { |
53 SetCommandLineSwitch(switches::kEnableDomDistiller); | 55 SetCommandLineSwitch(switches::kEnableDomDistiller); |
54 } | 56 } |
55 } | 57 } |
OLD | NEW |