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

Unified Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 8713017: Open the RestoreOnStartupURLs on first login, if specified by the admin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years 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/policy/configuration_policy_handler_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 1efdcdb8f1a9e94abab9428d0b65e12edb4176a9..7a1179f6725f66dc339dd8bcebad32895158cc05 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/login/existing_user_controller.h"
+#include <vector>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
@@ -29,6 +31,7 @@
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/dialog_style.h"
#include "chrome/browser/ui/views/window.h"
@@ -407,6 +410,7 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) {
// TODO(nkostylev): May add login UI implementation callback call.
if (!ready_for_browser_launch_) {
// Add the appropriate first-login URL.
+ std::vector<std::string> start_urls;
PrefService* prefs = g_browser_process->local_state();
const std::string current_locale =
StringToLowerASCII(prefs->GetString(prefs::kApplicationLocale));
@@ -420,7 +424,7 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) {
url = kGetStartedOwnerURLPattern;
start_url = base::StringPrintf(url, current_locale.c_str());
}
- CommandLine::ForCurrentProcess()->AppendArg(start_url);
+ start_urls.push_back(start_url);
ServicesCustomizationDocument* customization =
ServicesCustomizationDocument::GetInstance();
@@ -430,7 +434,7 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) {
std::string initial_start_page =
customization->GetInitialStartPage(locale);
if (!initial_start_page.empty())
- CommandLine::ForCurrentProcess()->AppendArg(initial_start_page);
+ start_urls.push_back(initial_start_page);
customization->ApplyCustomization();
}
@@ -438,9 +442,15 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) {
// If we have a two factor error and and this is a new user,
// load the personal settings page.
// TODO(stevenjb): direct the user to a lightweight sync login page.
- CommandLine::ForCurrentProcess()->AppendArg(kSettingsSyncLoginURL);
+ start_urls.push_back(kSettingsSyncLoginURL);
}
+ // Don't specify start URLs if the administrator has configured the start
+ // URLs via policy.
+ if (!SessionStartupPref::TypeIsManaged(profile->GetPrefs())) {
+ for (size_t i = 0; i < start_urls.size(); ++i)
+ CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]);
+ }
#ifndef NDEBUG
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kOobeSkipPostLogin)) {
« no previous file with comments | « no previous file | chrome/browser/policy/configuration_policy_handler_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698