| 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/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/values.h" | 21 #include "base/values.h" |
| 22 #include "cc/base/switches.h" | 22 #include "cc/base/switches.h" |
| 23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/browser/chromeos/boot_times_recorder.h" | 24 #include "chrome/browser/chromeos/boot_times_recorder.h" |
| 25 #include "chrome/browser/lifetime/application_lifetime.h" | 25 #include "chrome/browser/lifetime/application_lifetime.h" |
| 26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 27 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "chromeos/chromeos_switches.h" | 30 #include "chromeos/chromeos_switches.h" |
| 31 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 31 #include "chromeos/dbus/dbus_thread_manager.h" | 32 #include "chromeos/dbus/dbus_thread_manager.h" |
| 32 #include "chromeos/dbus/session_manager_client.h" | 33 #include "chromeos/dbus/session_manager_client.h" |
| 33 #include "chromeos/login/user_names.h" | 34 #include "chromeos/login/user_names.h" |
| 34 #include "components/policy/core/common/policy_switches.h" | 35 #include "components/policy/core/common/policy_switches.h" |
| 35 #include "components/prefs/json_pref_store.h" | 36 #include "components/prefs/json_pref_store.h" |
| 36 #include "components/prefs/pref_service.h" | 37 #include "components/prefs/pref_service.h" |
| 37 #include "components/signin/core/account_id/account_id.h" | 38 #include "components/signin/core/account_id/account_id.h" |
| 38 #include "components/tracing/tracing_switches.h" | 39 #include "components/tracing/tracing_switches.h" |
| 39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 40 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_switches.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } // namespace | 321 } // namespace |
| 321 | 322 |
| 322 void GetOffTheRecordCommandLine(const GURL& start_url, | 323 void GetOffTheRecordCommandLine(const GURL& start_url, |
| 323 bool is_oobe_completed, | 324 bool is_oobe_completed, |
| 324 const base::CommandLine& base_command_line, | 325 const base::CommandLine& base_command_line, |
| 325 base::CommandLine* command_line) { | 326 base::CommandLine* command_line) { |
| 326 base::DictionaryValue otr_switches; | 327 base::DictionaryValue otr_switches; |
| 327 otr_switches.SetString(switches::kGuestSession, std::string()); | 328 otr_switches.SetString(switches::kGuestSession, std::string()); |
| 328 otr_switches.SetString(::switches::kIncognito, std::string()); | 329 otr_switches.SetString(::switches::kIncognito, std::string()); |
| 329 otr_switches.SetString(::switches::kLoggingLevel, kGuestModeLoggingLevel); | 330 otr_switches.SetString(::switches::kLoggingLevel, kGuestModeLoggingLevel); |
| 330 otr_switches.SetString(switches::kLoginUser, | 331 otr_switches.SetString( |
| 331 login::GuestAccountId().GetUserEmail()); | 332 switches::kLoginUser, |
| 333 cryptohome::Identification(login::GuestAccountId()).id()); |
| 332 | 334 |
| 333 // Override the home page. | 335 // Override the home page. |
| 334 otr_switches.SetString(::switches::kHomePage, | 336 otr_switches.SetString(::switches::kHomePage, |
| 335 GURL(chrome::kChromeUINewTabURL).spec()); | 337 GURL(chrome::kChromeUINewTabURL).spec()); |
| 336 | 338 |
| 337 // If OOBE is not finished yet, lock down the guest session to not allow | 339 // If OOBE is not finished yet, lock down the guest session to not allow |
| 338 // surfing the web. Guest mode is still useful to inspect logs and run network | 340 // surfing the web. Guest mode is still useful to inspect logs and run network |
| 339 // diagnostics. | 341 // diagnostics. |
| 340 if (!is_oobe_completed) | 342 if (!is_oobe_completed) |
| 341 otr_switches.SetString(switches::kOobeGuestSession, std::string()); | 343 otr_switches.SetString(switches::kOobeGuestSession, std::string()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 357 // Relaunch chrome without session manager on dev box. | 359 // Relaunch chrome without session manager on dev box. |
| 358 ReLaunch(command_line); | 360 ReLaunch(command_line); |
| 359 return; | 361 return; |
| 360 } | 362 } |
| 361 | 363 |
| 362 // ChromeRestartRequest deletes itself after request sent to session manager. | 364 // ChromeRestartRequest deletes itself after request sent to session manager. |
| 363 (new ChromeRestartRequest(command_line.argv()))->Start(); | 365 (new ChromeRestartRequest(command_line.argv()))->Start(); |
| 364 } | 366 } |
| 365 | 367 |
| 366 } // namespace chromeos | 368 } // namespace chromeos |
| OLD | NEW |