Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(975)

Side by Side Diff: chrome/browser/android/chrome_startup_flags.cc

Issue 258663002: Expose a low-end device mode override flags for non-android OSs as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward command-line flags to renderer and gpu processes Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/android/sys_utils.h"
13 #include "base/command_line.h" 12 #include "base/command_line.h"
14 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/sys_utils.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 CommandLine* command_line = CommandLine::ForCurrentProcess();
24 if (!command_line->HasSwitch(switch_string)) 24 if (!command_line->HasSwitch(switch_string))
(...skipping 10 matching lines...) Expand all
35 } // namespace 35 } // namespace
36 36
37 void SetChromeSpecificCommandLineFlags() { 37 void SetChromeSpecificCommandLineFlags() {
38 // Enable prerender for the omnibox. 38 // Enable prerender for the omnibox.
39 SetCommandLineSwitchASCII(switches::kPrerenderMode, 39 SetCommandLineSwitchASCII(switches::kPrerenderMode,
40 switches::kPrerenderModeSwitchValueEnabled); 40 switches::kPrerenderModeSwitchValueEnabled);
41 SetCommandLineSwitchASCII(switches::kPrerenderFromOmnibox, 41 SetCommandLineSwitchASCII(switches::kPrerenderFromOmnibox,
42 switches::kPrerenderFromOmniboxSwitchValueEnabled); 42 switches::kPrerenderFromOmniboxSwitchValueEnabled);
43 43
44 // Disable syncing favicons on low end devices. 44 // Disable syncing favicons on low end devices.
45 if (base::android::SysUtils::IsLowEndDevice()) 45 if (base::SysUtils::IsLowEndDevice())
46 SetCommandLineSwitchASCII(switches::kDisableSyncTypes, "Favicon Images"); 46 SetCommandLineSwitchASCII(switches::kDisableSyncTypes, "Favicon Images");
47 47
48 // Enable DOM Distiller on local builds, canary and dev-channel. 48 // Enable DOM Distiller on local builds, canary and dev-channel.
49 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 49 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
50 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN || 50 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN ||
51 channel == chrome::VersionInfo::CHANNEL_CANARY || 51 channel == chrome::VersionInfo::CHANNEL_CANARY ||
52 channel == chrome::VersionInfo::CHANNEL_DEV) { 52 channel == chrome::VersionInfo::CHANNEL_DEV) {
53 SetCommandLineSwitch(switches::kEnableDomDistiller); 53 SetCommandLineSwitch(switches::kEnableDomDistiller);
54 } 54 }
55 55
56 // Enable the Fast Text Autosizer on local builds, canary and dev-channel. 56 // Enable the Fast Text Autosizer on local builds, canary and dev-channel.
57 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN || 57 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN ||
58 channel == chrome::VersionInfo::CHANNEL_CANARY || 58 channel == chrome::VersionInfo::CHANNEL_CANARY ||
59 channel == chrome::VersionInfo::CHANNEL_DEV) { 59 channel == chrome::VersionInfo::CHANNEL_DEV) {
60 SetCommandLineSwitch(switches::kEnableFastTextAutosizing); 60 SetCommandLineSwitch(switches::kEnableFastTextAutosizing);
61 } 61 }
62 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698