| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_restart_request.h" | 5 #include "chrome/browser/chromeos/login/chrome_restart_request.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/lifetime/application_lifetime.h" | 24 #include "chrome/browser/lifetime/application_lifetime.h" |
| 25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "chromeos/chromeos_switches.h" | 29 #include "chromeos/chromeos_switches.h" |
| 30 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
| 31 #include "chromeos/dbus/session_manager_client.h" | 31 #include "chromeos/dbus/session_manager_client.h" |
| 32 #include "chromeos/login/user_names.h" | 32 #include "chromeos/login/user_names.h" |
| 33 #include "components/policy/core/common/policy_switches.h" | 33 #include "components/policy/core/common/policy_switches.h" |
| 34 #include "components/user_manager/user_id.h" |
| 34 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
| 35 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
| 36 #include "gpu/command_buffer/service/gpu_switches.h" | 37 #include "gpu/command_buffer/service/gpu_switches.h" |
| 37 #include "media/base/media_switches.h" | 38 #include "media/base/media_switches.h" |
| 38 #include "third_party/cros_system_api/switches/chrome_switches.h" | 39 #include "third_party/cros_system_api/switches/chrome_switches.h" |
| 39 #include "ui/app_list/app_list_switches.h" | 40 #include "ui/app_list/app_list_switches.h" |
| 40 #include "ui/base/ui_base_switches.h" | 41 #include "ui/base/ui_base_switches.h" |
| 41 #include "ui/compositor/compositor_switches.h" | 42 #include "ui/compositor/compositor_switches.h" |
| 42 #include "ui/events/event_switches.h" | 43 #include "ui/events/event_switches.h" |
| 43 #include "ui/gfx/switches.h" | 44 #include "ui/gfx/switches.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 337 |
| 337 std::string GetOffTheRecordCommandLine( | 338 std::string GetOffTheRecordCommandLine( |
| 338 const GURL& start_url, | 339 const GURL& start_url, |
| 339 bool is_oobe_completed, | 340 bool is_oobe_completed, |
| 340 const base::CommandLine& base_command_line, | 341 const base::CommandLine& base_command_line, |
| 341 base::CommandLine* command_line) { | 342 base::CommandLine* command_line) { |
| 342 base::DictionaryValue otr_switches; | 343 base::DictionaryValue otr_switches; |
| 343 otr_switches.SetString(switches::kGuestSession, std::string()); | 344 otr_switches.SetString(switches::kGuestSession, std::string()); |
| 344 otr_switches.SetString(::switches::kIncognito, std::string()); | 345 otr_switches.SetString(::switches::kIncognito, std::string()); |
| 345 otr_switches.SetString(::switches::kLoggingLevel, kGuestModeLoggingLevel); | 346 otr_switches.SetString(::switches::kLoggingLevel, kGuestModeLoggingLevel); |
| 346 otr_switches.SetString(switches::kLoginUser, chromeos::login::kGuestUserName); | 347 otr_switches.SetString(switches::kLoginUser, chromeos::login::GetGuestUserID()
.GetUserEmail()); |
| 347 | 348 |
| 348 // Override the home page. | 349 // Override the home page. |
| 349 otr_switches.SetString(::switches::kHomePage, | 350 otr_switches.SetString(::switches::kHomePage, |
| 350 GURL(chrome::kChromeUINewTabURL).spec()); | 351 GURL(chrome::kChromeUINewTabURL).spec()); |
| 351 | 352 |
| 352 // If OOBE is not finished yet, lock down the guest session to not allow | 353 // If OOBE is not finished yet, lock down the guest session to not allow |
| 353 // surfing the web. Guest mode is still useful to inspect logs and run network | 354 // surfing the web. Guest mode is still useful to inspect logs and run network |
| 354 // diagnostics. | 355 // diagnostics. |
| 355 if (!is_oobe_completed) | 356 if (!is_oobe_completed) |
| 356 otr_switches.SetString(switches::kOobeGuestSession, std::string()); | 357 otr_switches.SetString(switches::kOobeGuestSession, std::string()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 375 // Relaunch chrome without session manager on dev box. | 376 // Relaunch chrome without session manager on dev box. |
| 376 ReLaunch(command_line); | 377 ReLaunch(command_line); |
| 377 return; | 378 return; |
| 378 } | 379 } |
| 379 | 380 |
| 380 // ChromeRestartRequest deletes itself after request sent to session manager. | 381 // ChromeRestartRequest deletes itself after request sent to session manager. |
| 381 (new ChromeRestartRequest(command_line))->Start(); | 382 (new ChromeRestartRequest(command_line))->Start(); |
| 382 } | 383 } |
| 383 | 384 |
| 384 } // namespace chromeos | 385 } // namespace chromeos |
| OLD | NEW |