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

Unified Diff: chrome/browser/android/chrome_startup_flags.cc

Issue 10690006: Upstream changes needed by Android auto-login. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Peter's comments Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/infobars/infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/chrome_startup_flags.cc
diff --git a/chrome/browser/android/chrome_startup_flags.cc b/chrome/browser/android/chrome_startup_flags.cc
index c6f99f081b573d4e8a7d76672ac86ec6b6b25835..5cafcc34f9da647d9248fabb7b4ee22103d75816 100644
--- a/chrome/browser/android/chrome_startup_flags.cc
+++ b/chrome/browser/android/chrome_startup_flags.cc
@@ -21,29 +21,38 @@ void SetCommandLineSwitch(const std::string& switch_string) {
command_line->AppendSwitch(switch_string);
}
+void SetCommandLineSwitchASCII(const std::string& switch_string,
+ const std::string& value) {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(switch_string))
+ command_line->AppendSwitchASCII(switch_string, value);
+}
+
bool IsTabletUi() {
NOTIMPLEMENTED() << "TODO(yfriedman): Upstream this";
return false;
}
-} // namespace
-void SetChromeSpecificCommandLineFlags() {
- CommandLine* parsed_command_line = CommandLine::ForCurrentProcess();
+} // namespace
- // Always enable SPDY
- parsed_command_line->AppendSwitch(switches::kEnableNpn);
+void SetChromeSpecificCommandLineFlags() {
+ // Always enable SPDY.
+ SetCommandLineSwitch(switches::kEnableNpn);
- // Turn on autofill
+ // Turn on autofill.
SetCommandLineSwitch(switches::kExternalAutofillPopup);
+ // Turn on autologin.
+ SetCommandLineSwitch(switches::kEnableAutologin);
+
// Tablet UI switch (used for using correct version of NTP HTML).
if (IsTabletUi())
- parsed_command_line->AppendSwitch(switches::kTabletUi);
+ SetCommandLineSwitch(switches::kTabletUi);
// Enable prerender for the omnibox.
- parsed_command_line->AppendSwitchASCII(
+ SetCommandLineSwitchASCII(
switches::kPrerenderMode, switches::kPrerenderModeSwitchValueEnabled);
- parsed_command_line->AppendSwitchASCII(
+ SetCommandLineSwitchASCII(
switches::kPrerenderFromOmnibox,
switches::kPrerenderFromOmniboxSwitchValueEnabled);
}
« no previous file with comments | « no previous file | chrome/browser/infobars/infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698