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" |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/chrome_version_info.h" | 16 #include "chrome/common/chrome_version_info.h" |
17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
18 #include "media/base/media_switches.h" | 18 #include "media/base/media_switches.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 void SetCommandLineSwitch(const std::string& switch_string) { | 22 void SetCommandLineSwitch(const std::string& switch_string) { |
23 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 23 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
24 if (!command_line->HasSwitch(switch_string)) | 24 if (!command_line->HasSwitch(switch_string)) |
25 command_line->AppendSwitch(switch_string); | 25 command_line->AppendSwitch(switch_string); |
26 } | 26 } |
27 | 27 |
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 base::CommandLine* command_line = base::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. | 38 // Enable prerender with holdback. |
39 SetCommandLineSwitchASCII(switches::kPrerenderMode, | 39 SetCommandLineSwitchASCII(switches::kPrerenderMode, |
40 switches::kPrerenderModeSwitchValueAuto); | 40 switches::kPrerenderModeSwitchValueAuto); |
41 | 41 |
42 // Enable prerender for the omnibox. | 42 // Enable prerender for the omnibox. |
43 SetCommandLineSwitchASCII(switches::kPrerenderFromOmnibox, | 43 SetCommandLineSwitchASCII(switches::kPrerenderFromOmnibox, |
44 switches::kPrerenderFromOmniboxSwitchValueEnabled); | 44 switches::kPrerenderFromOmniboxSwitchValueEnabled); |
45 | 45 |
46 // Disable syncing favicons on low end devices. | 46 // Disable syncing favicons on low end devices. |
47 if (base::SysInfo::IsLowEndDevice()) | 47 if (base::SysInfo::IsLowEndDevice()) |
48 SetCommandLineSwitchASCII(switches::kDisableSyncTypes, "Favicon Images"); | 48 SetCommandLineSwitchASCII(switches::kDisableSyncTypes, "Favicon Images"); |
49 | 49 |
50 // Enable DOM Distiller backend. | 50 // Enable DOM Distiller backend. |
51 SetCommandLineSwitch(switches::kEnableDomDistiller); | 51 SetCommandLineSwitch(switches::kEnableDomDistiller); |
52 } | 52 } |
OLD | NEW |