diff options
35 files changed, 54 insertions, 1007 deletions
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index e75bcb0..fb834a2 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp @@ -1472,28 +1472,6 @@ Press any key to continue exploring. Reset </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_HEADING" desc="Heading at the top of the Terms of Service screen."> - <ph name="DOMAIN">$1<ex>example.com</ex></ph> Terms of Service - </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_CONTENT_HEADING" desc="Heading at the start of the the Terms of Service text."> - <ph name="DOMAIN">$1<ex>example.com</ex></ph> Terms - </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_LOADING" desc="Message shown while the Terms of Service are being downloaded."> - loading... - </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_ERROR" desc="Error message shown when the Terms of Service could not be loaded."> - Oops, something went wrong. - </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_TRY_AGAIN" desc="Message telling the user to try again later. Shown beneath the error message when the Terms of Service could not be loaded."> - Please try again later. - </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_BACK_BUTTON" desc="Text of the back button on Terms of Service screen."> - Back - </message> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_ACCEPT_BUTTON" desc="Text of the accept button on the Terms of Service screen."> - Accept and continue - </message> - <message name="IDS_OPTION_DISABLED_BY_POLICY" desc="Tooltip for options managed by enterprise policy"> This option is controlled by enterprise policy. Please contact your administrator for more information. </message> diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 2c679e6..4f07b67 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd @@ -974,13 +974,6 @@ For Chromium, processes used to display diagnostics information (such as this "a <message name="IDS_APP_LIST_SIGNIN_TEXT" desc="Text for when the launcher needs to sign in."> You need to be signed into Chromium to use apps. This allows Chromium to sync your apps, bookmarks, history, passwords and other settings across devices. </message> - - <!-- Chrome OS OOBE Terms of Service screen--> - <if expr="pp_ifdef('chromeos')"> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_SUBHEADING" desc="Subheading at the top of the Terms of Service screen."> - <ph name="DOMAIN">$1<ex>example.com</ex></ph> requires that you read and accept the following Terms of Service before using this device. These terms do not expand, modify or limit the Chromium OS Terms. - </message> - </if> </messages> </release> </grit> diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index ae3b2ef..5f8dee1 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd @@ -883,7 +883,7 @@ For Google Chrome, processes used to display diagnostics information (such as th <message name="IDS_KEYBOARD_OVERLAY_SHOW_WRENCH_MENU" desc="The text in the keyboard overlay to explain the shortcut that opens the main Chrome menu."> Show the Chrome menu </message> - </if> + </if> <!-- App list --> <message name="IDS_APP_LIST_SHORTCUT_NAME" desc="Name for the Chrome App List to appear in the taskbar and in any shortcuts to it."> @@ -898,13 +898,6 @@ For Google Chrome, processes used to display diagnostics information (such as th <message name="IDS_APP_LIST_SIGNIN_TEXT" desc="Text for when the launcher needs to sign in."> You need to be signed into Chrome to use apps. This allows Chrome to sync your apps, bookmarks, history, passwords and other settings across devices. </message> - - <!-- Chrome OS OOBE Terms of Service screen--> - <if expr="pp_ifdef('chromeos')"> - <message name="IDS_TERMS_OF_SERVICE_SCREEN_SUBHEADING" desc="Subheading at the top of the Terms of Service screen."> - <ph name="DOMAIN">$1<ex>example.com</ex></ph> requires that you read and accept the following Terms of Service before using this device. These terms do not expand, modify or limit the Google Chrome OS Terms. - </message> - </if> </messages> </release> </grit> diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json index 3deb282..0b89f46 100644 --- a/chrome/app/policy/policy_templates.json +++ b/chrome/app/policy/policy_templates.json @@ -112,7 +112,7 @@ # persistent IDs for all fields (but not for groups!) are needed. These are # specified by the 'id' keys of each policy. NEVER CHANGE EXISTING IDs, # because doing so would break the deployed wire format! -# For your editing convenience: highest ID currently used: 185 +# For your editing convenience: highest ID currently used: 184 # # Placeholders: # The following placeholder strings are automatically substituted: @@ -3875,26 +3875,6 @@ The policy value should be specified in milliseconds. Values are clamped to a range of 30 seconds to 24 hours.''', }, { - 'name': 'TermsOfServiceURL', - 'type': 'string', - 'schema': { 'type': 'string' }, - 'supported_on': ['chrome_os:26-'], - 'features': { - 'dynamic_refresh': True, - 'per_profile': False, - }, - 'example_value': 'http://www.example.com/terms_of_service.txt', - 'id': 172, - 'caption': '''Set the Terms of Service for a device-local account''', - 'desc': '''Sets the Terms of Service that the user must accept before starting a device-local account session. - - If this policy is set, <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> will download the Terms of Service and present them to the user whenever a device-local account session is starting. The user will only be allowed into the session after accepting the Terms of Service. - - If this policy is not set, no Terms of Service are shown. - - The policy should be set to a URL from which <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> can download the Terms of Service. The Terms of Service must be plain text, served as MIME type text/plain. No markup is allowed.''', - }, - { 'name': 'PowerManagement', 'type': 'group', 'caption': '''Power mangement''', @@ -3912,7 +3892,7 @@ 'per_profile': False, }, 'example_value': 420000, - 'id': 173, + 'id': 172, 'caption': '''Screen dim delay when running on AC power''', 'desc': '''Specifies the length of time without user input after which the screen is dimmed when running on AC power. @@ -3934,7 +3914,7 @@ 'per_profile': False, }, 'example_value': 480000, - 'id': 174, + 'id': 173, 'caption': '''Screen off delay when running on AC power''', 'desc': '''Specifies the length of time without user input after which the screen is turned off when running on AC power. @@ -3956,7 +3936,7 @@ 'per_profile': False, }, 'example_value': 600000, - 'id': 175, + 'id': 174, 'caption': '''Screen lock delay when running on AC power''', 'desc': '''Specifies the length of time without user input after which the screen is locked when running on AC power. @@ -3980,7 +3960,7 @@ 'per_profile': False, }, 'example_value': 1800000, - 'id': 176, + 'id': 175, 'caption': '''Idle delay when running on AC power''', 'desc': '''Specifies the length of time without user input after which the idle action is taken when running on AC power. @@ -4000,7 +3980,7 @@ 'per_profile': False, }, 'example_value': 300000, - 'id': 177, + 'id': 176, 'caption': '''Screen dim delay when running on battery power''', 'desc': '''Specifies the length of time without user input after which the screen is dimmed when running on battery power. @@ -4022,7 +4002,7 @@ 'per_profile': False, }, 'example_value': 360000, - 'id': 178, + 'id': 177, 'caption': '''Screen off delay when running on battery power''', 'desc': '''Specifies the length of time without user input after which the screen is turned off when running on battery power. @@ -4044,7 +4024,7 @@ 'per_profile': False, }, 'example_value': 600000, - 'id': 179, + 'id': 178, 'caption': '''Screen lock delay when running on battery power''', 'desc': '''Specifies the length of time without user input after which the screen is locked when running on battery power. @@ -4068,7 +4048,7 @@ 'per_profile': False, }, 'example_value': 600000, - 'id': 180, + 'id': 179, 'caption': '''Idle delay when running on battery power''', 'desc': '''Specifies the length of time without user input after which the idle action is taken when running on battery power. @@ -4113,7 +4093,7 @@ 'per_profile': False, }, 'example_value': 0, - 'id': 181, + 'id': 180, 'caption': '''Action to take when the idle delay is reached''', 'desc': '''Specify the action to take when the idle delay is reached. @@ -4158,7 +4138,7 @@ 'per_profile': False, }, 'example_value': 0, - 'id': 182, + 'id': 181, 'caption': '''Action to take when the user closes the lid''', 'desc': '''Specify the action to take when the user closes the lid. @@ -4178,7 +4158,7 @@ 'per_profile': False, }, 'example_value': True, - 'id': 183, + 'id': 182, 'caption': '''Specify whether audio activity affects power management''', 'desc': '''Specifies whether audio activity affects power management. @@ -4196,7 +4176,7 @@ 'per_profile': False, }, 'example_value': True, - 'id': 184, + 'id': 183, 'caption': '''Specify whether video activity affects power management''', 'desc': '''Specifies whether vidoe activity affects power management. @@ -4214,7 +4194,7 @@ 'per_profile': False, }, 'example_value': 200, - 'id': 185, + 'id': 184, 'caption': '''Percentage by which to scale the idle delay in presentation mode''', 'desc': '''Specifies the percentage by which the idle delay is scaled when the device is in presentation node. diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index f7bed81..c098e0b 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -720,12 +720,17 @@ void ExistingUserController::OnLoginSuccess( } void ExistingUserController::OnProfilePrepared(Profile* profile) { + bool known_user = !UserManager::Get()->IsCurrentUserNew(); + bool skip_image_screen = + WizardController::default_controller()->skip_user_image_selection(); + ready_for_browser_launch_ = known_user || skip_image_screen; + OptionallyShowReleaseNotes(profile); // Reenable clicking on other windows and status area. login_display_->SetUIEnabled(true); - if (UserManager::Get()->IsCurrentUserNew()) { + if (!ready_for_browser_launch_) { // Don't specify start URLs if the administrator has configured the start // URLs via policy. if (!SessionStartupPref::TypeIsManaged(profile->GetPrefs())) @@ -733,12 +738,13 @@ void ExistingUserController::OnProfilePrepared(Profile* profile) { #ifndef NDEBUG if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kOobeSkipPostLogin)) { + ready_for_browser_launch_ = true; LoginUtils::Get()->DoBrowserLaunch(profile, host_); host_ = NULL; } else { #endif ActivateWizard(WizardController::IsDeviceRegistered() ? - WizardController::kTermsOfServiceScreenName : + WizardController::kUserImageScreenName : WizardController::kRegistrationScreenName); #ifndef NDEBUG } @@ -895,8 +901,7 @@ void ExistingUserController::InitializeStartUrls() const { start_urls.push_back(url); } } - // Skip the default first-run behavior for public accounts. - } else if (!UserManager::Get()->IsLoggedInAsPublicAccount()) { + } else { if (prefs->GetBoolean(prefs::kSpokenFeedbackEnabled)) { const char* url = kChromeVoxTutorialURLPattern; const std::string current_locale = diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index 51df654..73e5f0d 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h @@ -234,6 +234,9 @@ class ExistingUserController : public LoginDisplay::Delegate, // Factory of callbacks. base::WeakPtrFactory<ExistingUserController> weak_factory_; + // Whether everything is ready to launch the browser. + bool ready_for_browser_launch_; + // The displayed email for the next login attempt set by |SetDisplayEmail|. std::string display_email_; diff --git a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc index 03995c3..d9c8497 100644 --- a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc @@ -26,7 +26,6 @@ #include "chrome/test/base/ui_test_utils.h" #include "chromeos/dbus/mock_dbus_thread_manager.h" #include "chromeos/dbus/mock_session_manager_client.h" -#include "chromeos/dbus/mock_shill_manager_client.h" #include "google_apis/gaia/mock_url_fetcher_factory.h" #include "grit/generated_resources.h" #include "testing/gmock/include/gmock/gmock.h" @@ -131,18 +130,6 @@ class ExistingUserControllerTest : public CrosInProcessBrowserTest { new MockDBusThreadManager; EXPECT_CALL(*mock_dbus_thread_manager, GetSystemBus()) .WillRepeatedly(Return(reinterpret_cast<dbus::Bus*>(NULL))); - EXPECT_CALL(*mock_dbus_thread_manager, GetIBusInputContextClient()) - .WillRepeatedly( - Return(reinterpret_cast<IBusInputContextClient*>(NULL))); - EXPECT_CALL(*mock_dbus_thread_manager->mock_shill_manager_client(), - GetProperties(_)) - .Times(AnyNumber()); - EXPECT_CALL(*mock_dbus_thread_manager->mock_shill_manager_client(), - AddPropertyChangedObserver(_)) - .Times(AnyNumber()); - EXPECT_CALL(*mock_dbus_thread_manager->mock_shill_manager_client(), - RemovePropertyChangedObserver(_)) - .Times(AnyNumber()); DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager); CrosInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); cros_mock_->InitStatusAreaMocks(); @@ -187,9 +174,6 @@ class ExistingUserControllerTest : public CrosInProcessBrowserTest { EXPECT_CALL(*mock_user_manager_.user_manager(), IsLoggedInAsDemoUser()) .Times(AnyNumber()) .WillRepeatedly(Return(false)); - EXPECT_CALL(*mock_user_manager_.user_manager(), IsLoggedInAsPublicAccount()) - .Times(AnyNumber()) - .WillRepeatedly(Return(false)); EXPECT_CALL(*mock_user_manager_.user_manager(), IsSessionStarted()) .Times(AnyNumber()) .WillRepeatedly(Return(false)); @@ -283,7 +267,7 @@ IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, ExistingUserLogin) { EXPECT_CALL(*mock_login_display_, OnFadeOut()) .Times(1); EXPECT_CALL(*mock_login_display_host_, - StartWizard(WizardController::kTermsOfServiceScreenName, NULL)) + StartWizard(WizardController::kUserImageScreenName, NULL)) .Times(0); EXPECT_CALL(*mock_user_manager_.user_manager(), IsCurrentUserNew()) .Times(AnyNumber()) @@ -322,14 +306,12 @@ IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, EXPECT_CALL(*mock_login_display_host_, StartWizard(WizardController::kEnterpriseEnrollmentScreenName, _)) .Times(0); - // This will be the first sign-in of a new user, which may cause the (legacy) - // registration to be activated. A real WizardController instance immediately - // advances to the Terms of Service or user image screen but this test uses - // MockLoginDisplayHost Instead. + // That will be sign in of a new user and (legacy) registration screen is + // activated. In a real WizardController instance that is immediately switched + // to image screen but this tests uses MockLoginDisplayHost instead. EXPECT_CALL(*mock_login_display_host_, StartWizard(AnyOf(WizardController::kRegistrationScreenName, - WizardController::kTermsOfServiceScreenName), - NULL)) + WizardController::kUserImageScreenName), _)) .Times(1); EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) .Times(1) diff --git a/chrome/browser/chromeos/login/oobe_display.h b/chrome/browser/chromeos/login/oobe_display.h index 10be189..0a54c59 100644 --- a/chrome/browser/chromeos/login/oobe_display.h +++ b/chrome/browser/chromeos/login/oobe_display.h @@ -15,7 +15,6 @@ class EnterpriseEnrollmentScreenActor; class EulaScreenActor; class NetworkScreenActor; class ResetScreenActor; -class TermsOfServiceScreenActor; class UpdateScreenActor; class UserImageScreenActor; // TODO(altimofeev): use real actors instead @@ -42,7 +41,6 @@ class OobeDisplay { virtual EnterpriseEnrollmentScreenActor* GetEnterpriseEnrollmentScreenActor() = 0; virtual ResetScreenActor* GetResetScreenActor() = 0; - virtual TermsOfServiceScreenActor* GetTermsOfServiceScreenActor() = 0; virtual UserImageScreenActor* GetUserImageScreenActor() = 0; // TODO(altimofeev): use real actors instead. virtual ViewScreenDelegate* GetRegistrationScreenActor() = 0; diff --git a/chrome/browser/chromeos/login/screen_observer.h b/chrome/browser/chromeos/login/screen_observer.h index ec66eaa..d35b09b 100644 --- a/chrome/browser/chromeos/login/screen_observer.h +++ b/chrome/browser/chromeos/login/screen_observer.h @@ -35,8 +35,6 @@ class ScreenObserver { ENTERPRISE_ENROLLMENT_COMPLETED, ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED, RESET_CANCELED, - TERMS_OF_SERVICE_DECLINED, - TERMS_OF_SERVICE_ACCEPTED, EXIT_CODES_COUNT // not a real code, must be the last }; diff --git a/chrome/browser/chromeos/login/terms_of_service_screen.cc b/chrome/browser/chromeos/login/terms_of_service_screen.cc index 42adc17..e69de29 100644 --- a/chrome/browser/chromeos/login/terms_of_service_screen.cc +++ b/chrome/browser/chromeos/login/terms_of_service_screen.cc @@ -1,152 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/login/terms_of_service_screen.h" - -#include <string> - -#include "base/location.h" -#include "base/logging.h" -#include "base/time.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/chromeos/login/screen_observer.h" -#include "chrome/browser/chromeos/login/user.h" -#include "chrome/browser/chromeos/login/user_manager.h" -#include "chrome/browser/chromeos/login/wizard_controller.h" -#include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_manager.h" -#include "chrome/common/pref_names.h" -#include "google_apis/gaia/gaia_auth_util.h" -#include "googleurl/src/gurl.h" -#include "net/http/http_response_headers.h" -#include "net/url_request/url_fetcher.h" -#include "net/url_request/url_request_context_getter.h" -#include "net/url_request/url_request_status.h" - -namespace chromeos { - -TermsOfServiceScreen::TermsOfServiceScreen(ScreenObserver* screen_observer, - TermsOfServiceScreenActor* actor) - : WizardScreen(screen_observer), - actor_(actor) { - DCHECK(actor_); - if (actor_) - actor_->SetDelegate(this); -} - -TermsOfServiceScreen::~TermsOfServiceScreen() { - if (actor_) - actor_->SetDelegate(NULL); -} - -void TermsOfServiceScreen::PrepareToShow() { -} - -void TermsOfServiceScreen::Show() { - if (!actor_) - return; - - // Set the domain name whose Terms of Service are being shown. - actor_->SetDomain(gaia::ExtractDomainName( - UserManager::Get()->GetLoggedInUser()->email())); - - // Show the screen. - actor_->Show(); - - // Start downloading the Terms of Service. - StartDownload(); -} - -void TermsOfServiceScreen::Hide() { - if (actor_) - actor_->Hide(); -} - -std::string TermsOfServiceScreen::GetName() const { - return WizardController::kTermsOfServiceScreenName; -} - -void TermsOfServiceScreen::OnDecline() { - get_screen_observer()->OnExit(ScreenObserver::TERMS_OF_SERVICE_DECLINED); -} - -void TermsOfServiceScreen::OnAccept() { - get_screen_observer()->OnExit(ScreenObserver::TERMS_OF_SERVICE_ACCEPTED); -} - -void TermsOfServiceScreen::OnActorDestroyed(TermsOfServiceScreenActor* actor) { - if (actor_ == actor) - actor_ = NULL; -} - -void TermsOfServiceScreen::StartDownload() { - const PrefService* prefs = ProfileManager::GetDefaultProfile()->GetPrefs(); - // If an URL from which the Terms of Service can be downloaded has not been - // set, show an error message to the user. - std::string terms_of_service_url = - prefs->GetString(prefs::kTermsOfServiceURL); - if (terms_of_service_url.empty()) { - if (actor_) - actor_->OnLoadError(); - return; - } - - // Start downloading the Terms of Service. - terms_of_service_fetcher_.reset(net::URLFetcher::Create( - GURL(terms_of_service_url), net::URLFetcher::GET, this)); - terms_of_service_fetcher_->SetRequestContext( - g_browser_process->system_request_context()); - // Request a text/plain MIME type as only plain-text Terms of Service are - // accepted. - terms_of_service_fetcher_->AddExtraRequestHeader("Accept: text/plain"); - // Retry up to three times if network changes are detected during the - // download. - terms_of_service_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3); - terms_of_service_fetcher_->Start(); - - // Abort the download attempt if it takes longer than one minute. - download_timer_.Start(FROM_HERE, base::TimeDelta::FromMinutes(1), - this, &TermsOfServiceScreen::OnDownloadTimeout); -} - -void TermsOfServiceScreen::OnDownloadTimeout() { - // Abort the download attempt. - terms_of_service_fetcher_.reset(); - - // Show an error message to the user. - if (actor_) - actor_->OnLoadError(); -} - -void TermsOfServiceScreen::OnURLFetchComplete(const net::URLFetcher* source) { - if (source != terms_of_service_fetcher_.get()) { - NOTREACHED() << "Callback from foreign URL fetcher"; - return; - } - - download_timer_.Stop(); - - // Destroy the fetcher when this method returns. - scoped_ptr<net::URLFetcher> fetcher(terms_of_service_fetcher_.Pass()); - if (!actor_) - return; - - std::string terms_of_service; - std::string mime_type; - // If the Terms of Service could not be downloaded, do not have a MIME type of - // text/plain or are empty, show an error message to the user. - if (!source->GetStatus().is_success() || - !source->GetResponseHeaders()->GetMimeType(&mime_type) || - mime_type != "text/plain" || - !source->GetResponseAsString(&terms_of_service)) { - actor_->OnLoadError(); - } else { - // If the Terms of Service were downloaded successfully, show them to the - // user. - actor_->OnLoadSuccess(terms_of_service); - } -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/login/terms_of_service_screen.h b/chrome/browser/chromeos/login/terms_of_service_screen.h index 7388bd25..e69de29 100644 --- a/chrome/browser/chromeos/login/terms_of_service_screen.h +++ b/chrome/browser/chromeos/login/terms_of_service_screen.h @@ -1,70 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_H_ -#define CHROME_BROWSER_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_H_ - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "base/memory/scoped_ptr.h" -#include "base/timer.h" -#include "chrome/browser/chromeos/login/terms_of_service_screen_actor.h" -#include "chrome/browser/chromeos/login/wizard_screen.h" -#include "net/url_request/url_fetcher_delegate.h" - -namespace net { -class URLFetcher; -} - -namespace chromeos { - -class ScreenObserver; - -// A screen that shows Terms of Service which have been configured through -// policy. The screen is shown during login and requires the user to accept the -// Terms of Service before proceeding. Currently, Terms of Service are available -// for public sessions only. -class TermsOfServiceScreen : public WizardScreen, - public TermsOfServiceScreenActor::Delegate, - public net::URLFetcherDelegate { - public: - TermsOfServiceScreen(ScreenObserver* screen_observer, - TermsOfServiceScreenActor* actor); - virtual ~TermsOfServiceScreen(); - - // WizardScreen: - virtual void PrepareToShow() OVERRIDE; - virtual void Show() OVERRIDE; - virtual void Hide() OVERRIDE; - virtual std::string GetName() const OVERRIDE; - - // TermsOfServiceScreenActor::Delegate: - virtual void OnDecline() OVERRIDE; - virtual void OnAccept() OVERRIDE; - virtual void OnActorDestroyed(TermsOfServiceScreenActor* actor) OVERRIDE; - - private: - // Start downloading the Terms of Service. - void StartDownload(); - - // Abort the attempt to download the Terms of Service if it takes too long. - void OnDownloadTimeout(); - - // net::URLFetcherDelegate: - virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; - - TermsOfServiceScreenActor* actor_; - - scoped_ptr<net::URLFetcher> terms_of_service_fetcher_; - - // Timer that enforces a custom (shorter) timeout on the attempt to download - // the Terms of Service. - base::OneShotTimer<TermsOfServiceScreen> download_timer_; - - DISALLOW_COPY_AND_ASSIGN(TermsOfServiceScreen); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_H_ diff --git a/chrome/browser/chromeos/login/terms_of_service_screen_actor.h b/chrome/browser/chromeos/login/terms_of_service_screen_actor.h index 83de139..e69de29 100644 --- a/chrome/browser/chromeos/login/terms_of_service_screen_actor.h +++ b/chrome/browser/chromeos/login/terms_of_service_screen_actor.h @@ -1,55 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_ACTOR_H_ -#define CHROME_BROWSER_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_ACTOR_H_ - -#include <string> - -namespace chromeos { - -// Interface for dependency injection between TermsOfServiceScreen and its -// WebUI representation. -class TermsOfServiceScreenActor { - public: - class Delegate { - public: - virtual ~Delegate() {} - - // Called when the user declines the Terms of Service. - virtual void OnDecline() = 0; - - // Called when the user accepts the Terms of Service. - virtual void OnAccept() = 0; - - // Called when actor is destroyed so there is no dead reference to it. - virtual void OnActorDestroyed(TermsOfServiceScreenActor* actor) = 0; - }; - - virtual ~TermsOfServiceScreenActor() {} - - // Sets screen this actor belongs to. - virtual void SetDelegate(Delegate* screen) = 0; - - // Shows the contents of the screen. - virtual void Show() = 0; - - // Hides the contents of the screen. - virtual void Hide() = 0; - - // Sets the domain name whose Terms of Service are being shown. - virtual void SetDomain(const std::string& domain) = 0; - - // Called when the download of the Terms of Service fails. Show an error - // message to the user. - virtual void OnLoadError() = 0; - - // Called when the download of the Terms of Service is successful. Shows the - // downloaded |terms_of_service| to the user. - virtual void OnLoadSuccess(const std::string& terms_of_service) = 0; -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_ACTOR_H_ diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index e620ec1..4066f70 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -34,7 +34,6 @@ #include "chrome/browser/chromeos/login/oobe_display.h" #include "chrome/browser/chromeos/login/registration_screen.h" #include "chrome/browser/chromeos/login/reset_screen.h" -#include "chrome/browser/chromeos/login/terms_of_service_screen.h" #include "chrome/browser/chromeos/login/update_screen.h" #include "chrome/browser/chromeos/login/user_image_screen.h" #include "chrome/browser/chromeos/login/user_manager.h" @@ -42,13 +41,10 @@ #include "chrome/browser/chromeos/settings/cros_settings_names.h" #include "chrome/browser/prefs/pref_registry_simple.h" #include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/options/options_util.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/session_manager_client.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" @@ -118,7 +114,6 @@ const char WizardController::kRegistrationScreenName[] = "register"; const char WizardController::kHTMLPageScreenName[] = "html"; const char WizardController::kEnterpriseEnrollmentScreenName[] = "enroll"; const char WizardController::kResetScreenName[] = "reset"; -const char WizardController::kTermsOfServiceScreenName[] = "tos"; // Passing this parameter as a "first screen" initiates full OOBE flow. const char WizardController::kOutOfBoxScreenName[] = "oobe"; @@ -262,15 +257,6 @@ chromeos::ResetScreen* WizardController::GetResetScreen() { return reset_screen_.get(); } -chromeos::TermsOfServiceScreen* WizardController::GetTermsOfServiceScreen() { - if (!terms_of_service_screen_.get()) { - terms_of_service_screen_.reset( - new chromeos::TermsOfServiceScreen( - this, oobe_display_->GetTermsOfServiceScreenActor())); - } - return terms_of_service_screen_.get(); -} - void WizardController::ShowNetworkScreen() { VLOG(1) << "Showing network screen."; SetStatusAreaVisible(false); @@ -305,14 +291,8 @@ void WizardController::ShowUpdateScreen() { } void WizardController::ShowUserImageScreen() { - const chromeos::UserManager* user_manager = chromeos::UserManager::Get(); - // Skip image selection if any of the following is true: - // * The user has logged in before (and thus, has selected an image already). - // * The user is logging in as ephemeral. - // * Image selection is explicitly being skipped for testing. - if (!user_manager->IsCurrentUserNew() || - user_manager->IsCurrentUserNonCryptohomeDataEphemeral() || - skip_user_image_selection_) { + // Skip image selection if the user is logging in as ephemeral. + if (chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral()) { OnUserImageSkipped(); return; } @@ -371,22 +351,6 @@ void WizardController::ShowResetScreen() { SetCurrentScreen(GetResetScreen()); } -void WizardController::ShowTermsOfServiceScreen() { - // Only show the Terms of Service when logging into a public account and Terms - // of Service have been specified through policy. In all other cases, advance - // to the user image screen immediately. - if (!chromeos::UserManager::Get()->IsLoggedInAsPublicAccount() || - !ProfileManager::GetDefaultProfile()->GetPrefs()->IsManagedPreference( - prefs::kTermsOfServiceURL)) { - ShowUserImageScreen(); - return; - } - - VLOG(1) << "Showing Terms of Service screen."; - SetStatusAreaVisible(true); - SetCurrentScreen(GetTermsOfServiceScreen()); -} - void WizardController::SkipToLoginForTesting() { MarkEulaAccepted(); PerformPostEulaActions(); @@ -544,7 +508,7 @@ void WizardController::OnRegistrationSuccess() { } chromeos::LoginUtils::Get()->CompleteOffTheRecordLogin(start_url); } else { - ShowTermsOfServiceScreen(); + ShowUserImageScreen(); } } @@ -574,17 +538,6 @@ void WizardController::OnOOBECompleted() { ShowLoginScreen(); } -void WizardController::OnTermsOfServiceDeclined() { - // If the user declines the Terms of Service, end the session and return to - // the login screen. - DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); -} - -void WizardController::OnTermsOfServiceAccepted() { - // If the user accepts the Terms of Service, advance to the user image screen. - ShowUserImageScreen(); -} - void WizardController::InitiateOOBEUpdate() { PerformPostEulaActions(); GetUpdateScreen()->StartUpdate(); @@ -675,8 +628,6 @@ void WizardController::AdvanceToScreen(const std::string& screen_name) { ShowHTMLPageScreen(); } else if (screen_name == kEnterpriseEnrollmentScreenName) { ShowEnterpriseEnrollmentScreen(); - } else if (screen_name == kTermsOfServiceScreenName) { - ShowTermsOfServiceScreen(); } else if (screen_name != kTestNoScreenName) { if (is_out_of_box_) { ShowNetworkScreen(); @@ -839,12 +790,6 @@ void WizardController::OnExit(ExitCodes exit_code) { case ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED: OnEnterpriseAutoEnrollmentDone(); break; - case TERMS_OF_SERVICE_DECLINED: - OnTermsOfServiceDeclined(); - break; - case TERMS_OF_SERVICE_ACCEPTED: - OnTermsOfServiceAccepted(); - break; default: NOTREACHED(); } diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h index bb411a9..33a9359 100644 --- a/chrome/browser/chromeos/login/wizard_controller.h +++ b/chrome/browser/chromeos/login/wizard_controller.h @@ -34,7 +34,6 @@ class NetworkScreen; class OobeDisplay; class RegistrationScreen; class ResetScreen; -class TermsOfServiceScreen; class UpdateScreen; class UserImageScreen; class WizardScreen; @@ -61,6 +60,11 @@ class WizardController : public ScreenObserver { return default_controller_; } + // Whether the user image selection step should be skipped. + static bool skip_user_image_selection() { + return skip_user_image_selection_; + } + // Returns true if EULA has been accepted. static bool IsEulaAccepted(); @@ -133,7 +137,6 @@ class WizardController : public ScreenObserver { HTMLPageScreen* GetHTMLPageScreen(); EnterpriseEnrollmentScreen* GetEnterpriseEnrollmentScreen(); ResetScreen* GetResetScreen(); - TermsOfServiceScreen* GetTermsOfServiceScreen(); // Returns a pointer to the current screen or NULL if there's no such // screen. @@ -153,7 +156,6 @@ class WizardController : public ScreenObserver { static const char kHTMLPageScreenName[]; static const char kEnterpriseEnrollmentScreenName[]; static const char kResetScreenName[]; - static const char kTermsOfServiceScreenName[]; private: // Show specific screen. @@ -165,7 +167,6 @@ class WizardController : public ScreenObserver { void ShowHTMLPageScreen(); void ShowEnterpriseEnrollmentScreen(); void ShowResetScreen(); - void ShowTermsOfServiceScreen(); // Shows images login screen. void ShowLoginScreen(); @@ -189,8 +190,6 @@ class WizardController : public ScreenObserver { void OnEnterpriseAutoEnrollmentDone(); void OnResetCanceled(); void OnOOBECompleted(); - void OnTermsOfServiceDeclined(); - void OnTermsOfServiceAccepted(); // Loads brand code on I/O enabled thread and stores to Local State. void LoadBrandCodeFromFile(); @@ -229,7 +228,6 @@ class WizardController : public ScreenObserver { // Logs in the specified user via default login screen. void Login(const std::string& username, const std::string& password); - // Whether the user image selection step should be skipped. static bool skip_user_image_selection_; static bool zero_delay_enabled_; @@ -244,7 +242,6 @@ class WizardController : public ScreenObserver { scoped_ptr<HTMLPageScreen> html_page_screen_; scoped_ptr<EnterpriseEnrollmentScreen> enterprise_enrollment_screen_; - scoped_ptr<TermsOfServiceScreen> terms_of_service_screen_; // Screen that's currently active. WizardScreen* current_screen_; diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index ca8a1b6..8942431 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -330,7 +330,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 -COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 16, +COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 14, add_tests_for_new_control_flow_you_just_introduced); } // namespace chromeos diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 444364c..3d4e98b 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -335,10 +335,6 @@ void Preferences::RegisterUserPrefs(PrefServiceSyncable* prefs) { prefs->RegisterDoublePref(prefs::kPowerPresentationIdleDelayFactor, 2.0, PrefServiceSyncable::UNSYNCABLE_PREF); - - prefs->RegisterStringPref(prefs::kTermsOfServiceURL, - "", - PrefServiceSyncable::UNSYNCABLE_PREF); } void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) { diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/chrome/browser/policy/configuration_policy_handler_list.cc index 54d9089..aac9a19 100644 --- a/chrome/browser/policy/configuration_policy_handler_list.cc +++ b/chrome/browser/policy/configuration_policy_handler_list.cc @@ -348,9 +348,6 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { { key::kSessionLengthLimit, prefs::kSessionLengthLimit, Value::TYPE_INTEGER }, - { key::kTermsOfServiceURL, - prefs::kTermsOfServiceURL, - Value::TYPE_STRING }, { key::kPowerManagementUsesAudioActivity, prefs::kPowerUseAudioActivity, Value::TYPE_BOOLEAN }, diff --git a/chrome/browser/resources/chromeos/login/display_manager.js b/chrome/browser/resources/chromeos/login/display_manager.js index 99add52..5c86d33 100644 --- a/chrome/browser/resources/chromeos/login/display_manager.js +++ b/chrome/browser/resources/chromeos/login/display_manager.js @@ -170,7 +170,7 @@ cr.define('cr.ui.login', function() { */ disableButtons_: function(screen, disabled) { var buttons = document.querySelectorAll( - '#' + screen.id + '-controls button:not(.preserve-disabled-state)'); + '#' + screen.id + '-controls button'); for (var i = 0; i < buttons.length; ++i) { buttons[i].disabled = disabled; } diff --git a/chrome/browser/resources/chromeos/login/login.html b/chrome/browser/resources/chromeos/login/login.html index dcbfd5b..c9fdbfa 100644 --- a/chrome/browser/resources/chromeos/login/login.html +++ b/chrome/browser/resources/chromeos/login/login.html @@ -18,7 +18,6 @@ <link rel="stylesheet" href="screen_tpm_error.css"> <link rel="stylesheet" href="screen_password_changed.css"> <link rel="stylesheet" href="managed_user_creation.css"> -<link rel="stylesheet" href="oobe_screen_terms_of_service.css"> <link rel="stylesheet" href="user_pod_row.css"> <script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/event_tracker.js"></script> @@ -50,7 +49,6 @@ <script src="screen_error_message.js"></script> <script src="screen_tpm_error.js"></script> <script src="screen_password_changed.js"></script> -<script src="oobe_screen_terms_of_service.js"></script> <script src="user_pod_row.js"></script> </head> <body class="login-display" i18n-values=".style.fontFamily:fontfamily;"> @@ -75,10 +73,9 @@ <include src="screen_account_picker.html"> <include src="screen_error_message.html"> <include src="screen_tpm_error.html"> - <include src="screen_password_changed.html"> + <include src="screen_password_changed.html"> <include src="managed_user_creation.html"> <include src="oobe_screen_reset.html"> - <include src="oobe_screen_terms_of_service.html"> </div> <hr class="bottom shadow"> <div id="footer"> diff --git a/chrome/browser/resources/chromeos/login/login.js b/chrome/browser/resources/chromeos/login/login.js index 58948d4..6abe0fe 100644 --- a/chrome/browser/resources/chromeos/login/login.js +++ b/chrome/browser/resources/chromeos/login/login.js @@ -42,7 +42,6 @@ cr.define('cr.ui', function() { login.TPMErrorMessageScreen.register(); login.PasswordChangedScreen.register(); login.ManagedUserCreationScreen.register(); - oobe.TermsOfServiceScreen.register(); cr.ui.Bubble.decorate($('bubble')); login.HeaderBar.decorate($('login-header-bar')); @@ -235,34 +234,6 @@ cr.define('cr.ui', function() { login.AccountPickerScreen.forceLockedUserPodFocus(); }; - /** - * Sets the domain name whose Terms of Service are being shown on the Terms of - * Service screen. - * @param {string} domain The domain name. - */ - Oobe.setTermsOfServiceDomain = function(domain) { - oobe.TermsOfServiceScreen.setDomain(domain); - }; - - /** - * Displays an error message on the Terms of Service screen. Called when the - * download of the Terms of Service has failed. - */ - Oobe.setTermsOfServiceLoadError = function() { - $('terms-of-service').classList.remove('tos-loading'); - $('terms-of-service').classList.add('error'); - }; - - /** - * Displays the given |termsOfService| on the Terms of Service screen. - * @param {string} termsOfService The terms of service, as plain text. - */ - Oobe.setTermsOfService = function(termsOfService) { - $('terms-of-service').classList.remove('tos-loading'); - $('tos-content-main').textContent = termsOfService; - $('tos-accept-button').disabled = false; - }; - // Export return { Oobe: Oobe diff --git a/chrome/browser/resources/chromeos/login/oobe.css b/chrome/browser/resources/chromeos/login/oobe.css index 5304080..a8219a2 100644 --- a/chrome/browser/resources/chromeos/login/oobe.css +++ b/chrome/browser/resources/chromeos/login/oobe.css @@ -71,8 +71,7 @@ button:not(.custom-appearance) { #back-button, #reset-button, -#password-changed-back-button, -#tos-back-button { +#password-changed-back-button { -webkit-margin-end: 8px; } @@ -127,8 +126,7 @@ html[oobe=new] #oobe.update #inner-container, html[oobe=new] #oobe.user-image #inner-container, html[oobe=new] #oobe.managed-user-creation #inner-container, html[oobe=new] #oobe.tpm-error-message #inner-container, -html[oobe=new] #oobe.password-changed #inner-container, -html[oobe=new] #oobe.terms-of-service #inner-container { +html[oobe=new] #oobe.password-changed #inner-container { background: -webkit-linear-gradient(rgba(255,255,255,0.99), rgba(255,255,255,0.95)); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), @@ -876,8 +874,7 @@ html[oobe=old] .step-controls { #error-message-dot, #tpm-error-message-dot, #password-changed-dot, -#managed-user-creation-dot, -#terms-of-service-dot { +#managed-user-creation-dot { display: none; } @@ -982,6 +979,7 @@ html[oobe=old] #update div { display: -webkit-box; } + html[oobe=old] #update #update-screen-curtain { margin: 9em auto; } @@ -1067,16 +1065,14 @@ html[oobe=old] #update progress { } #cros-eula, -#oem-eula, -#tos-container { +#oem-eula { border: 1px solid #d9d9d9; height: 200px; } html[oobe=new] .eula-frame, html[oobe=new] #cros-eula, -html[oobe=new] #oem-eula, -html[oobe=new] #tos-container { +html[oobe=new] #oem-eula { height: 222px; } @@ -1084,9 +1080,11 @@ html[oobe=new] #tos-container { border-left: none; } -#eulas.one-column #cros-eula, -#eulas.one-column #cros-eula-frame, -#tos-container { +#eulas.one-column #cros-eula { + width: 100%; +} + +#eulas.one-column #cros-eula-frame { width: 100%; } diff --git a/chrome/browser/resources/chromeos/login/oobe.html b/chrome/browser/resources/chromeos/login/oobe.html index f5b4213..b29432b 100644 --- a/chrome/browser/resources/chromeos/login/oobe.html +++ b/chrome/browser/resources/chromeos/login/oobe.html @@ -18,7 +18,6 @@ <link rel="stylesheet" href="screen_error_message.css"> <link rel="stylesheet" href="screen_tpm_error.css"> <link rel="stylesheet" href="screen_password_changed.css"> -<link rel="stylesheet" href="oobe_screen_terms_of_service.css"> <link rel="stylesheet" href="user_pod_row.css"> <script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/event_tracker.js"></script> @@ -53,7 +52,6 @@ <script src="screen_error_message.js"></script> <script src="screen_tpm_error.js"></script> <script src="screen_password_changed.js"></script> -<script src="oobe_screen_terms_of_service.js"></script> <script src="user_pod_row.js"></script> </head> <body i18n-values=".style.fontFamily:fontfamily;"> @@ -84,7 +82,6 @@ <include src="screen_tpm_error.html"> <include src="screen_password_changed.html"> <include src="oobe_screen_reset.html"> - <include src="oobe_screen_terms_of_service.html"> </div> <hr class="bottom shadow"> <div id="footer"> diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js index 1f70006..c0487a0 100644 --- a/chrome/browser/resources/chromeos/login/oobe.js +++ b/chrome/browser/resources/chromeos/login/oobe.js @@ -78,7 +78,6 @@ cr.define('cr.ui', function() { login.TPMErrorMessageScreen.register(); login.PasswordChangedScreen.register(); login.ManagedUserCreationScreen.register(); - oobe.TermsOfServiceScreen.register(); cr.ui.Bubble.decorate($('bubble')); login.HeaderBar.decorate($('login-header-bar')); @@ -489,34 +488,6 @@ cr.define('cr.ui', function() { login.AccountPickerScreen.forceLockedUserPodFocus(); }; - /** - * Sets the domain name whose Terms of Service are being shown on the Terms of - * Service screen. - * @param {string} domain The domain name. - */ - Oobe.setTermsOfServiceDomain = function(domain) { - oobe.TermsOfServiceScreen.setDomain(domain); - }; - - /** - * Displays an error message on the Terms of Service screen. Called when the - * download of the Terms of Service has failed. - */ - Oobe.setTermsOfServiceLoadError = function() { - $('terms-of-service').classList.remove('tos-loading'); - $('terms-of-service').classList.add('error'); - }; - - /** - * Displays the given |termsOfService| on the Terms of Service screen. - * @param {string} termsOfService The terms of service, as plain text. - */ - Oobe.setTermsOfService = function(termsOfService) { - $('terms-of-service').classList.remove('tos-loading'); - $('tos-content-main').textContent = termsOfService; - $('tos-accept-button').disabled = false; - }; - // Export return { Oobe: Oobe diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.css b/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.css index 0620d54..e69de29 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.css +++ b/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.css @@ -1,88 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -html[oobe=new] #terms-of-service { - padding: 70px 17px 21px; -} - -html[oobe=new] #terms-of-service .step-contents { - -webkit-margin-after: 49px; - -webkit-margin-start: 32px; -} - -#terms-of-service h1 { - font-size: 100%; - font-weight: normal; - margin: 0 0 8px 0; - width: 630px; -} - -#tos-subheading { - color: rgb(100, 100, 100); - font-size: 11px; - margin: 0 0 27px 0; - width: 630px; -} - -#tos-container { - -webkit-margin-end: -2px; - overflow: auto; - width: 630px; -} - -#tos-content { - padding: 8px 13px; -} - -#terms-of-service h2 { - font-size: 100%; - margin: 0 0 13px 0; -} - -#tos-content-main { - white-space: pre-wrap; -} - -#tos-loading, -#tos-error { - -webkit-align-items: center; - -webkit-flex-direction: column; - -webkit-justify-content: center; - display: none; - height: 100%; - width: 100%; -} - -#terms-of-service p { - color: rgb(100, 100, 100); - font-size: 12px; - margin: 0; - text-align: center; -} - -#terms-of-service p + p { - margin-top: 4px; -} - -.step.tos-loading #tos-content { - display: none; -} - -.step.tos-loading #tos-loading { - display: -webkit-flex; -} - -.step.error #tos-content, -.step.error #tos-accept-button { - display: none; -} - -.step.error #tos-error { - display: -webkit-flex; -} - -#terms-of-service.error #tos-back-button { - -webkit-margin-end: 1px; -} diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.html b/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.html index 2758d13..e69de29 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.html +++ b/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.html @@ -1,24 +0,0 @@ -<div class="step right hidden tos-loading" id="terms-of-service"> - <div class="step-contents"> - <h1 id="tos-heading"></h1> - <div id="tos-subheading"></div> - <div id="tos-container"> - <div id="tos-content"> - <h2 id="tos-content-heading"></h2> - <span id="tos-content-main"></span> - </div> - <div id="tos-loading"> - <div> - <p i18n-content="termsOfServiceLoading"></p> - </div> - </div> - <div id="tos-error"> - <div> - <p i18n-content="termsOfServiceError"></p> - <p i18n-content="termsOfServiceTryAgain"></p> - </div> - </div> - </div> - </div> - <div id="terms-of-service-controls" class="step-controls"></div> -</div> diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.js b/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.js index b27696051..e69de29 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.js +++ b/chrome/browser/resources/chromeos/login/oobe_screen_terms_of_service.js @@ -1,94 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Oobe Terms of Service screen implementation. - */ - -cr.define('oobe', function() { - /** - * Create a new Terms of Service screen. - * @constructor - * @extends {HTMLDivElement} - */ - var TermsOfServiceScreen = cr.ui.define('div'); - - /** - * Register with Oobe. - */ - TermsOfServiceScreen.register = function() { - var screen = $('terms-of-service'); - TermsOfServiceScreen.decorate(screen); - Oobe.getInstance().registerScreen(screen); - }; - - /** - * Updates headings on the screen to indicate that the Terms of Service being - * shown belong to |domain|. - * @param {string} domain The domain whose Terms of Service are being shown. - */ - TermsOfServiceScreen.setDomain = function(domain) { - $('tos-heading').textContent = - localStrings.getStringF('termsOfServiceScreenHeading', domain); - $('tos-subheading').textContent = - localStrings.getStringF('termsOfServiceScreenSubheading', domain); - $('tos-content-heading').textContent = - localStrings.getStringF('termsOfServiceContentHeading', domain); - }; - - TermsOfServiceScreen.prototype = { - // Set up the prototype chain. - __proto__: HTMLDivElement.prototype, - - /** @override */ - decorate: function() { - }, - - /** - * Buttons in Oobe wizard's button strip. - * @type {array} Array of Buttons. - */ - get buttons() { - var buttons = []; - - var backButton = this.ownerDocument.createElement('button'); - backButton.id = 'tos-back-button'; - backButton.textContent = - localStrings.getString('termsOfServiceBackButton'); - backButton.addEventListener('click', function(event) { - $('tos-back-button').disabled = true; - $('tos-accept-button').disabled = true; - chrome.send('termsOfServiceBack'); - }); - buttons.push(backButton); - - var acceptButton = this.ownerDocument.createElement('button'); - acceptButton.id = 'tos-accept-button'; - acceptButton.disabled = true; - acceptButton.classList.add('preserve-disabled-state'); - acceptButton.textContent = - localStrings.getString('termsOfServiceAcceptButton'); - acceptButton.addEventListener('click', function(event) { - $('tos-back-button').disabled = true; - $('tos-accept-button').disabled = true; - chrome.send('termsOfServiceAccept'); - }); - buttons.push(acceptButton); - - return buttons; - }, - - /** - * Event handler that is invoked just before the screen is shown. - * @param {object} data Screen init payload. - */ - onBeforeShow: function(data) { - Oobe.getInstance().headerHidden = true; - }, - }; - - return { - TermsOfServiceScreen: TermsOfServiceScreen - }; -}); diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc index b25d5e9f..9d850f8 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc @@ -29,7 +29,6 @@ #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h" @@ -141,7 +140,6 @@ const char OobeUI::kScreenUserImagePicker[] = "user-image"; const char OobeUI::kScreenTpmError[] = "tpm-error-message"; const char OobeUI::kScreenPasswordChanged[] = "password-changed"; const char OobeUI::kScreenManagedUserCreation[] = "managed-user-creation"; -const char OobeUI::kScreenTermsOfService[] = "terms-of-service"; OobeUI::OobeUI(content::WebUI* web_ui) : WebUIController(web_ui), @@ -151,7 +149,6 @@ OobeUI::OobeUI(content::WebUI* web_ui) reset_screen_actor_(NULL), error_screen_handler_(NULL), signin_screen_handler_(NULL), - terms_of_service_screen_actor_(NULL), user_image_screen_actor_(NULL), current_screen_(SCREEN_UNKNOWN) { InitializeScreenMaps(); @@ -188,11 +185,6 @@ OobeUI::OobeUI(content::WebUI* web_ui) enterprise_oauth_enrollment_screen_handler; AddScreenHandler(enterprise_oauth_enrollment_screen_handler); - TermsOfServiceScreenHandler* terms_of_service_screen_handler = - new TermsOfServiceScreenHandler; - terms_of_service_screen_actor_ = terms_of_service_screen_handler; - AddScreenHandler(terms_of_service_screen_handler); - UserImageScreenHandler* user_image_screen_handler = new UserImageScreenHandler(); user_image_screen_actor_ = user_image_screen_handler; @@ -263,10 +255,6 @@ ResetScreenActor* OobeUI::GetResetScreenActor() { return reset_screen_actor_; } -TermsOfServiceScreenActor* OobeUI::GetTermsOfServiceScreenActor() { - return terms_of_service_screen_actor_; -} - UserImageScreenActor* OobeUI::GetUserImageScreenActor() { return user_image_screen_actor_; } @@ -335,7 +323,6 @@ void OobeUI::InitializeScreenMaps() { screen_names_[SCREEN_TPM_ERROR] = kScreenTpmError; screen_names_[SCREEN_PASSWORD_CHANGED] = kScreenPasswordChanged; screen_names_[SCREEN_CREATE_MANAGED_USER] = kScreenManagedUserCreation; - screen_names_[SCREEN_TERMS_OF_SERVICE] = kScreenTermsOfService; screen_ids_.clear(); for (size_t i = 0; i < screen_names_.size(); ++i) diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h index 1e215a6..9f2acd8 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h @@ -51,7 +51,6 @@ class OobeUI : public OobeDisplay, SCREEN_TPM_ERROR, SCREEN_PASSWORD_CHANGED, SCREEN_CREATE_MANAGED_USER, - SCREEN_TERMS_OF_SERVICE, SCREEN_UNKNOWN }; @@ -67,7 +66,6 @@ class OobeUI : public OobeDisplay, static const char kScreenTpmError[]; static const char kScreenPasswordChanged[]; static const char kScreenManagedUserCreation[]; - static const char kScreenTermsOfService[]; explicit OobeUI(content::WebUI* web_ui); virtual ~OobeUI(); @@ -81,8 +79,6 @@ class OobeUI : public OobeDisplay, virtual EnterpriseEnrollmentScreenActor* GetEnterpriseEnrollmentScreenActor() OVERRIDE; virtual ResetScreenActor* GetResetScreenActor() OVERRIDE; - virtual TermsOfServiceScreenActor* - GetTermsOfServiceScreenActor() OVERRIDE; virtual UserImageScreenActor* GetUserImageScreenActor() OVERRIDE; virtual ViewScreenDelegate* GetRegistrationScreenActor() OVERRIDE; virtual ViewScreenDelegate* GetHTMLPageScreenActor() OVERRIDE; @@ -142,8 +138,6 @@ class OobeUI : public OobeDisplay, // Reference to SigninScreenHandler that handles sign-in screen requests and // forward calls from native code to JS side. SigninScreenHandler* signin_screen_handler_; - - TermsOfServiceScreenActor* terms_of_service_screen_actor_; UserImageScreenActor* user_image_screen_actor_; std::vector<BaseScreenHandler*> handlers_; // Non-owning pointers. diff --git a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc index 7a9c272..e69de29 100644 --- a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc @@ -1,150 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/values.h" -#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" -#include "content/public/browser/web_ui.h" -#include "grit/chromium_strings.h" -#include "grit/generated_resources.h" -#include "ui/base/l10n/l10n_util.h" - -namespace chromeos { - -TermsOfServiceScreenHandler::TermsOfServiceScreenHandler() - : screen_(NULL), - show_on_init_(false), - load_error_(false) { -} - -TermsOfServiceScreenHandler::~TermsOfServiceScreenHandler() { - if (screen_) - screen_->OnActorDestroyed(this); -} - -void TermsOfServiceScreenHandler::RegisterMessages() { - web_ui()->RegisterMessageCallback("termsOfServiceBack", - base::Bind(&TermsOfServiceScreenHandler::HandleBack, - base::Unretained(this))); - web_ui()->RegisterMessageCallback("termsOfServiceAccept", - base::Bind(&TermsOfServiceScreenHandler::HandleAccept, - base::Unretained(this))); -} - -void TermsOfServiceScreenHandler::GetLocalizedStrings( - base::DictionaryValue *localized_strings) { - localized_strings->SetString("termsOfServiceScreenHeading", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_HEADING)); - localized_strings->SetString("termsOfServiceScreenSubheading", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_SUBHEADING)); - localized_strings->SetString("termsOfServiceContentHeading", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_CONTENT_HEADING)); - localized_strings->SetString("termsOfServiceLoading", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_LOADING)); - localized_strings->SetString("termsOfServiceError", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_ERROR)); - localized_strings->SetString("termsOfServiceTryAgain", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_TRY_AGAIN)); - localized_strings->SetString("termsOfServiceBackButton", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_BACK_BUTTON)); - localized_strings->SetString("termsOfServiceAcceptButton", - l10n_util::GetStringUTF16(IDS_TERMS_OF_SERVICE_SCREEN_ACCEPT_BUTTON)); -} - -void TermsOfServiceScreenHandler::SetDelegate(Delegate* screen) { - screen_ = screen; -} - -void TermsOfServiceScreenHandler::Show() { - if (!page_is_ready()) { - show_on_init_ = true; - return; - } - - // Updates the domain name shown in the UI. - UpdateDomainInUI(); - - // Update the UI to show an error message or the Terms of Service. - UpdateTermsOfServiceInUI(); - - ShowScreen(OobeUI::kScreenTermsOfService, NULL); -} - -void TermsOfServiceScreenHandler::Hide() { -} - -void TermsOfServiceScreenHandler::SetDomain(const std::string& domain) { - domain_ = domain; - UpdateDomainInUI(); -} - -void TermsOfServiceScreenHandler::OnLoadError() { - load_error_ = true; - terms_of_service_ = ""; - UpdateTermsOfServiceInUI(); -} - -void TermsOfServiceScreenHandler::OnLoadSuccess( - const std::string& terms_of_service) { - load_error_ = false; - terms_of_service_ = terms_of_service; - UpdateTermsOfServiceInUI(); -} - -void TermsOfServiceScreenHandler::Initialize() { - if (show_on_init_) { - Show(); - show_on_init_ = false; - } -} - -void TermsOfServiceScreenHandler::UpdateDomainInUI() { - if (!page_is_ready()) - return; - - base::StringValue domain(domain_); - web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfServiceDomain", - domain); -} - -void TermsOfServiceScreenHandler::UpdateTermsOfServiceInUI() { - if (!page_is_ready()) - return; - - // If either |load_error_| or |terms_of_service_| is set, the download of the - // Terms of Service has completed and the UI should be updated. Otherwise, the - // download is still in progress and the UI will be updated when the - // OnLoadError() or the OnLoadSuccess() callback is called. - if (load_error_) { - web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfServiceLoadError"); - } else if (!terms_of_service_.empty()) { - base::StringValue terms_of_service(terms_of_service_); - web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfService", - terms_of_service); - } -} - -void TermsOfServiceScreenHandler::HandleBack(const base::ListValue* args) { - if (screen_) - screen_->OnDecline(); -} - -void TermsOfServiceScreenHandler::HandleAccept(const base::ListValue* args) { - if (!screen_) - return; - - // If the Terms of Service have not been successfully downloaded, the "accept - // and continue" button should not be accessible. If the user managed to - // activate it somehow anway, do not treat this as acceptance of the Terms - // and Conditions and end the session instead, as if the user had declined. - if (terms_of_service_.empty()) - screen_->OnDecline(); - else - screen_->OnAccept(); -} - -} // namespace chromeos diff --git a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h index ab3daef..e69de29 100644 --- a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h @@ -1,82 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ - -#include <string> - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "chrome/browser/chromeos/login/terms_of_service_screen_actor.h" -#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" - -namespace base { -class ListValue; -} - -namespace chromeos { - -// The sole implementation of the TermsOfServiceScreenActor, using WebUI. -class TermsOfServiceScreenHandler : public BaseScreenHandler, - public TermsOfServiceScreenActor { - public: - TermsOfServiceScreenHandler(); - virtual ~TermsOfServiceScreenHandler(); - - // content::WebUIMessageHandler: - virtual void RegisterMessages() OVERRIDE; - - // BaseScreenHandler: - virtual void GetLocalizedStrings( - base::DictionaryValue* localized_strings) OVERRIDE; - - // TermsOfServiceScreenActor: - virtual void SetDelegate(Delegate* screen) OVERRIDE; - virtual void Show() OVERRIDE; - virtual void Hide() OVERRIDE; - virtual void SetDomain(const std::string& domain) OVERRIDE; - virtual void OnLoadError() OVERRIDE; - virtual void OnLoadSuccess(const std::string& terms_of_service) OVERRIDE; - - private: - // BaseScreenHandler: - virtual void Initialize() OVERRIDE; - - // Update the domain name shown in the UI. - void UpdateDomainInUI(); - - // Update the UI to show an error message or the Terms of Service, depending - // on whether the download of the Terms of Service was successful. Does - // nothing if the download is still in progress. - void UpdateTermsOfServiceInUI(); - - // Called when the user declines the Terms of Service by clicking the "back" - // button. - void HandleBack(const base::ListValue* args); - - // Called when the user accepts the Terms of Service by clicking the "accept - // and continue" button. - void HandleAccept(const base::ListValue* args); - - TermsOfServiceScreenHandler::Delegate* screen_; - - // Whether the screen should be shown right after initialization. - bool show_on_init_; - - // The domain name whose Terms of Service are being shown. - std::string domain_; - - // Set to |true| when the download of the Terms of Service fails. - bool load_error_; - - // Set to the Terms of Service when the download is successful. - std::string terms_of_service_; - - DISALLOW_COPY_AND_ASSIGN(TermsOfServiceScreenHandler); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H_ diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi index 34b878d..e06c499 100644 --- a/chrome/chrome_browser_chromeos.gypi +++ b/chrome/chrome_browser_chromeos.gypi @@ -451,9 +451,6 @@ 'browser/chromeos/login/screen_observer.h', 'browser/chromeos/login/simple_web_view_dialog.cc', 'browser/chromeos/login/simple_web_view_dialog.h', - 'browser/chromeos/login/terms_of_service_screen.cc', - 'browser/chromeos/login/terms_of_service_screen.h', - 'browser/chromeos/login/terms_of_service_screen_actor.h', 'browser/chromeos/login/test_attempt_state.cc', 'browser/chromeos/login/test_attempt_state.h', 'browser/chromeos/login/textfield_with_margin.cc', diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index 6b4f6cf8..38ac307 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -1875,8 +1875,6 @@ 'browser/ui/webui/chromeos/login/reset_screen_handler.h', 'browser/ui/webui/chromeos/login/signin_screen_handler.cc', 'browser/ui/webui/chromeos/login/signin_screen_handler.h', - 'browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc', - 'browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h', 'browser/ui/webui/chromeos/login/update_screen_handler.cc', 'browser/ui/webui/chromeos/login/update_screen_handler.h', 'browser/ui/webui/chromeos/login/user_image_screen_handler.cc', diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index ffeb124..4de6744 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -861,10 +861,6 @@ const char kPowerUseVideoActivity[] = "power.use_video_activity"; // presentation mode. Values are limited to a minimum of 1.0. const char kPowerPresentationIdleDelayFactor[] = "power.presentation_idle_delay_factor"; - -// The URL from which the Terms of Service can be downloaded. The value is only -// honored for public accounts. -const char kTermsOfServiceURL[] = "terms_of_service.url"; #endif // defined(OS_CHROMEOS) // The disabled messages in IPC logging. diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index db4b6c1..ad8c73c 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -305,7 +305,6 @@ extern const char kPowerLidClosedAction[]; extern const char kPowerUseAudioActivity[]; extern const char kPowerUseVideoActivity[]; extern const char kPowerPresentationIdleDelayFactor[]; -extern const char kTermsOfServiceURL[]; #endif // defined(OS_CHROMEOS) extern const char kIpcDisabledMessages[]; extern const char kShowHomeButton[]; diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 2e8299d..a6332a5 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json @@ -1558,14 +1558,6 @@ ] }, - "TermsOfServiceURL": { - "os": ["chromeos"], - "test_policy": { "TermsOfServiceURL": "http://www.example.com/terms_of_service.txt" }, - "pref_mappings": [ - { "pref": "terms_of_service.url" } - ] - }, - "ScreenDimDelayAC": { "os": ["chromeos"], "test_policy": { "ScreenDimDelayAC": 420000 }, |