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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 6602010: Added "--login-user=" option for the Guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos/login
Patch Set: merge Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Affixes for Auth token received from ClientLogin request. 65 // Affixes for Auth token received from ClientLogin request.
66 const char kAuthPrefix[] = "Auth="; 66 const char kAuthPrefix[] = "Auth=";
67 const char kAuthSuffix[] = "\n"; 67 const char kAuthSuffix[] = "\n";
68 68
69 // Increase logging level for Guest mode to avoid LOG(INFO) messages in logs. 69 // Increase logging level for Guest mode to avoid LOG(INFO) messages in logs.
70 const char kGuestModeLoggingLevel[] = "1"; 70 const char kGuestModeLoggingLevel[] = "1";
71 71
72 // Format of command line switch. 72 // Format of command line switch.
73 const char kSwitchFormatString[] = " --%s=\"%s\""; 73 const char kSwitchFormatString[] = " --%s=\"%s\"";
74 74
75 // User name which is used in the Guest session.
76 const char kGuestUserName[] = "";
77
75 // Resets the proxy configuration service for the default request context. 78 // Resets the proxy configuration service for the default request context.
76 class ResetDefaultProxyConfigServiceTask : public Task { 79 class ResetDefaultProxyConfigServiceTask : public Task {
77 public: 80 public:
78 ResetDefaultProxyConfigServiceTask( 81 ResetDefaultProxyConfigServiceTask(
79 net::ProxyConfigService* proxy_config_service) 82 net::ProxyConfigService* proxy_config_service)
80 : proxy_config_service_(proxy_config_service) {} 83 : proxy_config_service_(proxy_config_service) {}
81 virtual ~ResetDefaultProxyConfigServiceTask() {} 84 virtual ~ResetDefaultProxyConfigServiceTask() {}
82 85
83 // Task override. 86 // Task override.
84 virtual void Run() { 87 virtual void Run() {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 #endif 420 #endif
418 }; 421 };
419 command_line->CopySwitchesFrom(base_command_line, 422 command_line->CopySwitchesFrom(base_command_line,
420 kForwardSwitches, 423 kForwardSwitches,
421 arraysize(kForwardSwitches)); 424 arraysize(kForwardSwitches));
422 command_line->AppendSwitch(switches::kGuestSession); 425 command_line->AppendSwitch(switches::kGuestSession);
423 command_line->AppendSwitch(switches::kIncognito); 426 command_line->AppendSwitch(switches::kIncognito);
424 command_line->AppendSwitchASCII(switches::kLoggingLevel, 427 command_line->AppendSwitchASCII(switches::kLoggingLevel,
425 kGuestModeLoggingLevel); 428 kGuestModeLoggingLevel);
426 429
430 command_line->AppendSwitchASCII(switches::kLoginUser, kGuestUserName);
431
427 if (start_url.is_valid()) 432 if (start_url.is_valid())
428 command_line->AppendArg(start_url.spec()); 433 command_line->AppendArg(start_url.spec());
429 434
430 // Override the value of the homepage that is set in first run mode. 435 // Override the value of the homepage that is set in first run mode.
431 // TODO(altimofeev): extend action of the |kNoFirstRun| to cover this case. 436 // TODO(altimofeev): extend action of the |kNoFirstRun| to cover this case.
432 command_line->AppendSwitchASCII( 437 command_line->AppendSwitchASCII(
433 switches::kHomePage, 438 switches::kHomePage,
434 GURL(chrome::kChromeUINewTabURL).spec()); 439 GURL(chrome::kChromeUINewTabURL).spec());
435 440
436 std::string cmd_line_str = command_line->command_line_string(); 441 std::string cmd_line_str = command_line->command_line_string();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 BrowserInit browser_init; 584 BrowserInit browser_init;
580 int return_code; 585 int return_code;
581 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), 586 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(),
582 profile, 587 profile,
583 FilePath(), 588 FilePath(),
584 true, 589 true,
585 &return_code); 590 &return_code);
586 } 591 }
587 592
588 } // namespace chromeos 593 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698