From 26c41bb4872c546b2922522cd402e20cb3cb5980 Mon Sep 17 00:00:00 2001 From: "avayvod@chromium.org" Date: Fri, 27 May 2011 11:14:39 +0000 Subject: [PATCH] [cros] Refactored EulaView: split into EulaView, EulaScreen, EulaScreenActor. BUG=chromiumos:11632 TEST=Test that eula screen works as before. Review URL: http://codereview.chromium.org/7017040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87007 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chromeos/login/eula_screen.cc | 93 ++++++++++++++++++++++ chrome/browser/chromeos/login/eula_screen.h | 57 +++++++++++++ chrome/browser/chromeos/login/eula_screen_actor.h | 58 ++++++++++++++ chrome/browser/chromeos/login/eula_view.cc | 66 +++++---------- chrome/browser/chromeos/login/eula_view.h | 29 ++----- .../chromeos/login/views_eula_screen_actor.cc | 41 ++++++++++ .../chromeos/login/views_eula_screen_actor.h | 44 ++++++++++ chrome/browser/chromeos/login/wizard_controller.cc | 2 +- .../login/wizard_controller_browsertest.cc | 2 +- chrome/browser/chromeos/login/wizard_screen.h | 6 ++ chrome/chrome_browser.gypi | 5 ++ 11 files changed, 330 insertions(+), 73 deletions(-) create mode 100644 chrome/browser/chromeos/login/eula_screen.cc create mode 100644 chrome/browser/chromeos/login/eula_screen.h create mode 100644 chrome/browser/chromeos/login/eula_screen_actor.h create mode 100644 chrome/browser/chromeos/login/views_eula_screen_actor.cc create mode 100644 chrome/browser/chromeos/login/views_eula_screen_actor.h diff --git a/chrome/browser/chromeos/login/eula_screen.cc b/chrome/browser/chromeos/login/eula_screen.cc new file mode 100644 index 000000000000..3e098a8a9cab --- /dev/null +++ b/chrome/browser/chromeos/login/eula_screen.cc @@ -0,0 +1,93 @@ +// Copyright (c) 2011 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/eula_screen.h" + +#include "base/logging.h" +#include "chrome/browser/chromeos/cros/cros_library.h" +#include "chrome/browser/chromeos/cros/cryptohome_library.h" +#include "chrome/browser/chromeos/customization_document.h" +#include "chrome/browser/chromeos/login/screen_observer.h" +#include "chrome/browser/chromeos/login/views_eula_screen_actor.h" + +namespace { + +const char kGoogleEulaUrl[] = "about:terms"; + +} // namespace + +namespace chromeos { + +EulaScreen::EulaScreen(::WizardScreenDelegate* delegate) + : WizardScreen(delegate), + actor_(new ViewsEulaScreenActor(delegate)) { + actor_->SetDelegate(this); +} + +EulaScreen::~EulaScreen() { +} + +void EulaScreen::Show() { + // Command to own the TPM. + if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { + chromeos::CrosLibrary::Get()-> + GetCryptohomeLibrary()->TpmCanAttemptOwnership(); + } else { + LOG(ERROR) << "Cros library not loaded. " + << "We must have disabled the link that led here."; + } + actor_->Show(); +} + +void EulaScreen::Hide() { + actor_->Hide(); +} + +gfx::Size EulaScreen::GetScreenSize() const { + return actor_->GetScreenSize(); +} + +bool EulaScreen::IsTpmEnabled() const { + return chromeos::CrosLibrary::Get()->EnsureLoaded() && + chromeos::CrosLibrary::Get()->GetCryptohomeLibrary()->TpmIsEnabled(); +} + +GURL EulaScreen::GetGoogleEulaUrl() const { + return GURL(kGoogleEulaUrl); +} + +GURL EulaScreen::GetOemEulaUrl() const { + const StartupCustomizationDocument* customization = + StartupCustomizationDocument::GetInstance(); + if (customization->IsReady()) { + std::string locale = customization->initial_locale(); + std::string eula_page = customization->GetEULAPage(locale); + if (!eula_page.empty()) + return GURL(eula_page); + + VLOG(1) << "No eula found for locale: " << locale; + } else { + LOG(ERROR) << "No manifest found."; + } + return GURL(); +} + +void EulaScreen::OnExit(bool accepted) { + ScreenObserver* observer = delegate()->GetObserver(this); + observer->set_usage_statistics_reporting(actor_->IsUsageStatsChecked()); + observer->OnExit(accepted + ? ScreenObserver::EULA_ACCEPTED + : ScreenObserver::EULA_BACK); +} + +std::string* EulaScreen::GetTpmPasswordStorage() { + return &tpm_password_; +} + +bool EulaScreen::IsUsageStatsEnabled() const { + const ScreenObserver* observer = delegate()->GetObserver(this); + return observer->usage_statistics_reporting(); +} + +} // namespace chromeos diff --git a/chrome/browser/chromeos/login/eula_screen.h b/chrome/browser/chromeos/login/eula_screen.h new file mode 100644 index 000000000000..3e27602e9d95 --- /dev/null +++ b/chrome/browser/chromeos/login/eula_screen.h @@ -0,0 +1,57 @@ +// Copyright (c) 2011 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_EULA_SCREEN_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_H_ +#pragma once + +#include + +#include "base/scoped_ptr.h" +#include "chrome/browser/chromeos/login/eula_screen_actor.h" +#include "chrome/browser/chromeos/login/wizard_screen.h" +#include "googleurl/src/gurl.h" + +namespace chromeos { + +// Representation independent class that controls OOBE screen showing EULA +// to users. +class EulaScreen : public WizardScreen, + public EulaScreenActor::Delegate { + public: + explicit EulaScreen(WizardScreenDelegate* delegate); + virtual ~EulaScreen(); + + // WizardScreen implementation: + virtual void Show(); + virtual void Hide(); + virtual gfx::Size GetScreenSize() const; + + // EulaScreenActor::Delegate implementation: + virtual bool IsTpmEnabled() const; + virtual GURL GetGoogleEulaUrl() const; + virtual GURL GetOemEulaUrl() const; + virtual void OnExit(bool accepted); + virtual std::string* GetTpmPasswordStorage(); + virtual bool IsUsageStatsEnabled() const; + + private: + // URL of the OEM EULA page (on disk). + GURL oem_eula_page_; + + // TPM password local storage. By convention, we clear the password + // from TPM as soon as we read it. We store it here locally until + // EULA screen is closed. + // TODO(glotov): Sanitize memory used to store password when + // it's destroyed. + std::string tpm_password_; + + scoped_ptr actor_; + + DISALLOW_COPY_AND_ASSIGN(EulaScreen); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_H_ diff --git a/chrome/browser/chromeos/login/eula_screen_actor.h b/chrome/browser/chromeos/login/eula_screen_actor.h new file mode 100644 index 000000000000..b2baac06ec49 --- /dev/null +++ b/chrome/browser/chromeos/login/eula_screen_actor.h @@ -0,0 +1,58 @@ +// Copyright (c) 2011 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_EULA_SCREEN_ACTOR_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ +#pragma once + +#include "googleurl/src/gurl.h" +#include "ui/gfx/size.h" + +namespace chromeos { + +// Interface between eula screen and its representation, either WebUI or +// Views one. +class EulaScreenActor { + public: + // Allows us to get info from eula screen that we need. + class Delegate { + public: + virtual ~Delegate() {} + + // Returns true if TPM is enabled. + virtual bool IsTpmEnabled() const = 0; + + // Returns URL of the Google EULA page. + virtual GURL GetGoogleEulaUrl() const = 0; + + // Returns URL of the OEM EULA page that should be displayed using current + // locale and manifest. Returns empty URL otherwise. + virtual GURL GetOemEulaUrl() const = 0; + + // Called when screen is exited. |accepted| indicates if EULA was + // accepted or not. + virtual void OnExit(bool accepted) = 0; + + // Returns the string where TPM password will be stored. + virtual std::string* GetTpmPasswordStorage() = 0; + + // Returns true if usage statistics reporting is enabled. + virtual bool IsUsageStatsEnabled() const = 0; + }; + + virtual ~EulaScreenActor() {} + + virtual void Show() = 0; + virtual void Hide() = 0; + virtual gfx::Size GetScreenSize() const = 0; + + // Returns true if user decided to report usage statistics. + virtual bool IsUsageStatsChecked() const = 0; + virtual void SetDelegate(Delegate* delegate) = 0; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ + diff --git a/chrome/browser/chromeos/login/eula_view.cc b/chrome/browser/chromeos/login/eula_view.cc index 2b2c72a4ff8f..47143b4d6e50 100644 --- a/chrome/browser/chromeos/login/eula_view.cc +++ b/chrome/browser/chromeos/login/eula_view.cc @@ -17,13 +17,12 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/cros/cryptohome_library.h" -#include "chrome/browser/chromeos/customization_document.h" #include "chrome/browser/chromeos/login/background_view.h" #include "chrome/browser/chromeos/login/help_app_launcher.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" -#include "chrome/browser/chromeos/login/wizard_controller.h" +#include "chrome/browser/chromeos/login/views_eula_screen_actor.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/views/dom_view.h" #include "chrome/browser/ui/views/handle_web_keyboard_event_gtk.h" @@ -59,10 +58,6 @@ const int kMargin = 20; const int kTextMargin = 10; const int kTpmCheckIntervalMs = 500; -// TODO(glotov): this URL should be changed to actual Google ChromeOS EULA. -// See crbug.com/4647 -const char kGoogleEulaUrl[] = "about:terms"; - enum kLayoutColumnsets { SINGLE_CONTROL_ROW, SINGLE_CONTROL_WITH_SHIFT_ROW, @@ -218,6 +213,7 @@ void TpmInfoView::Init() { layout->AddView(busy_label_); layout->AddPaddingRow(0, views::kRelatedControlHorizontalSpacing); + // TODO(avayvod): Refactor this to be usable for WebUI. PullPassword(); } @@ -280,7 +276,7 @@ bool EULATabContentsDelegate::HandleContextMenu( //////////////////////////////////////////////////////////////////////////////// // EulaView, public: -EulaView::EulaView(chromeos::ScreenObserver* observer) +EulaView::EulaView(ViewsEulaScreenActor* actor) : google_eula_label_(NULL), google_eula_view_(NULL), usage_statistics_checkbox_(NULL), @@ -290,7 +286,7 @@ EulaView::EulaView(chromeos::ScreenObserver* observer) system_security_settings_link_(NULL), back_button_(NULL), continue_button_(NULL), - observer_(observer), + actor_(actor), bubble_(NULL) { } @@ -333,34 +329,7 @@ static void SetUpGridLayout(views::GridLayout* layout) { column_set->AddPaddingColumn(0, kLastButtonHorizontalMargin + kBorderSize); } -// Convenience function. Returns URL of the OEM EULA page that should be -// displayed using current locale and manifest. Returns empty URL otherwise. -static GURL GetOemEulaPagePath() { - const StartupCustomizationDocument* customization = - StartupCustomizationDocument::GetInstance(); - if (customization->IsReady()) { - std::string locale = customization->initial_locale(); - std::string eula_page = customization->GetEULAPage(locale); - if (!eula_page.empty()) - return GURL(eula_page); - - VLOG(1) << "No eula found for locale: " << locale; - } else { - LOG(ERROR) << "No manifest found."; - } - return GURL(); -} - void EulaView::Init() { - // First, command to own the TPM. - if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { - chromeos::CrosLibrary::Get()-> - GetCryptohomeLibrary()->TpmCanAttemptOwnership(); - } else { - LOG(ERROR) << "Cros library not loaded. " - << "We must have disabled the link that led here."; - } - // Use rounded rect background. views::Painter* painter = CreateWizardPainter( &BorderDefinition::kScreenBorder); @@ -397,7 +366,7 @@ void EulaView::Init() { usage_statistics_checkbox_ = new EULACheckbox(); usage_statistics_checkbox_->SetMultiLine(true); usage_statistics_checkbox_->SetChecked( - observer_->usage_statistics_reporting()); + actor_->screen()->IsUsageStatsEnabled()); layout->AddView(usage_statistics_checkbox_); layout->StartRow(0, SINGLE_LINK_WITH_SHIFT_ROW); @@ -411,7 +380,7 @@ void EulaView::Init() { layout->AddView(oem_eula_label_, 1, 1, views::GridLayout::LEADING, views::GridLayout::FILL); - oem_eula_page_ = GetOemEulaPagePath(); + oem_eula_page_ = actor_->screen()->GetOemEulaUrl(); if (!oem_eula_page_.is_empty()) { layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); layout->StartRow(1, SINGLE_CONTROL_ROW); @@ -429,9 +398,7 @@ void EulaView::Init() { system_security_settings_link_ = new views::Link(); system_security_settings_link_->set_listener(this); - if (!chromeos::CrosLibrary::Get()->EnsureLoaded() || - !chromeos::CrosLibrary::Get()->GetCryptohomeLibrary()-> - TpmIsEnabled()) { + if (!actor_->screen()->IsTpmEnabled()) { system_security_settings_link_->SetEnabled(false); } @@ -449,7 +416,9 @@ void EulaView::Init() { void EulaView::UpdateLocalizedStrings() { // Load Google EULA and its title. - LoadEulaView(google_eula_view_, google_eula_label_, GURL(kGoogleEulaUrl)); + LoadEulaView(google_eula_view_, + google_eula_label_, + actor_->screen()->GetGoogleEulaUrl()); // Load OEM EULA and its title. if (!oem_eula_page_.is_empty()) @@ -480,6 +449,10 @@ void EulaView::UpdateLocalizedStrings() { UTF16ToWide(l10n_util::GetStringUTF16(IDS_EULA_BACK_BUTTON))); } +bool EulaView::IsUsageStatsChecked() const { + return usage_statistics_checkbox_ && usage_statistics_checkbox_->checked(); +} + //////////////////////////////////////////////////////////////////////////////// // EulaView, protected, views::View implementation: @@ -492,14 +465,10 @@ void EulaView::OnLocaleChanged() { // views::ButtonListener implementation: void EulaView::ButtonPressed(views::Button* sender, const views::Event& event) { - if (usage_statistics_checkbox_) { - observer_->set_usage_statistics_reporting( - usage_statistics_checkbox_->checked()); - } if (sender == continue_button_) { - observer_->OnExit(ScreenObserver::EULA_ACCEPTED); + actor_->screen()->OnExit(true); } else if (sender == back_button_) { - observer_->OnExit(ScreenObserver::EULA_BACK); + actor_->screen()->OnExit(false); } } @@ -514,7 +483,8 @@ void EulaView::LinkClicked(views::Link* source, int event_flags) { help_app_ = new HelpAppLauncher(parent_window); help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); } else if (source == system_security_settings_link_) { - TpmInfoView* view = new TpmInfoView(&tpm_password_); + TpmInfoView* view = + new TpmInfoView(actor_->screen()->GetTpmPasswordStorage()); view->Init(); views::Window* window = browser::CreateViewsWindow(parent_window, gfx::Rect(), diff --git a/chrome/browser/chromeos/login/eula_view.h b/chrome/browser/chromeos/login/eula_view.h index 9cc5997bb5e3..8a7ee8bbec90 100644 --- a/chrome/browser/chromeos/login/eula_view.h +++ b/chrome/browser/chromeos/login/eula_view.h @@ -6,11 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_LOGIN_EULA_VIEW_H_ #pragma once -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" #include "chrome/browser/chromeos/login/message_bubble.h" -#include "chrome/browser/chromeos/login/view_screen.h" #include "content/browser/tab_contents/tab_contents_delegate.h" #include "ui/gfx/native_widget_types.h" #include "views/controls/button/button.h" @@ -31,7 +27,7 @@ class DOMView; namespace chromeos { class HelpAppLauncher; -class MetricsCrosSettingsProvider; +class ViewsEulaScreenActor; // Delegate for TabContents that will show EULA. // Blocks context menu and other actions. @@ -76,7 +72,7 @@ class EulaView public MessageBubbleDelegate, public EULATabContentsDelegate { public: - explicit EulaView(chromeos::ScreenObserver* observer); + explicit EulaView(ViewsEulaScreenActor* actor); virtual ~EulaView(); // Initialize view controls and layout. @@ -85,6 +81,9 @@ class EulaView // Update strings from the resources. Executed on language change. void UpdateLocalizedStrings(); + // Returns the state of usage stats checkbox. + bool IsUsageStatsChecked() const; + protected: // views::View implementation. virtual void OnLocaleChanged(); @@ -128,7 +127,7 @@ class EulaView views::NativeButton* back_button_; views::NativeButton* continue_button_; - chromeos::ScreenObserver* observer_; + ViewsEulaScreenActor* actor_; // URL of the OEM EULA page (on disk). GURL oem_eula_page_; @@ -140,25 +139,9 @@ class EulaView // it will be deleted on bubble closing. MessageBubble* bubble_; - // TPM password local storage. By convention, we clear the password - // from TPM as soon as we read it. We store it here locally until - // EULA screen is closed. - // TODO(glotov): Sanitize memory used to store password when - // it's destroyed. - std::string tpm_password_; - DISALLOW_COPY_AND_ASSIGN(EulaView); }; -class EulaScreen : public DefaultViewScreen { - public: - explicit EulaScreen(WizardScreenDelegate* delegate) - : DefaultViewScreen(delegate) { - } - private: - DISALLOW_COPY_AND_ASSIGN(EulaScreen); -}; - } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_VIEW_H_ diff --git a/chrome/browser/chromeos/login/views_eula_screen_actor.cc b/chrome/browser/chromeos/login/views_eula_screen_actor.cc new file mode 100644 index 000000000000..f054bfa91846 --- /dev/null +++ b/chrome/browser/chromeos/login/views_eula_screen_actor.cc @@ -0,0 +1,41 @@ +// Copyright (c) 2011 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/views_eula_screen_actor.h" + +namespace chromeos { + +ViewsEulaScreenActor::ViewsEulaScreenActor(WizardScreenDelegate* delegate) + : ViewScreen(delegate), + screen_(NULL) { +} + +ViewsEulaScreenActor::~ViewsEulaScreenActor() { +} + +EulaView* ViewsEulaScreenActor::AllocateView() { + return new EulaView(this); +} + +void ViewsEulaScreenActor::Show() { + ViewScreen::Show(); +} + +void ViewsEulaScreenActor::Hide() { + ViewScreen::Hide(); +} + +gfx::Size ViewsEulaScreenActor::GetScreenSize() const { + return ViewScreen::GetScreenSize(); +} + +bool ViewsEulaScreenActor::IsUsageStatsChecked() const { + return view() && view()->IsUsageStatsChecked(); +} + +void ViewsEulaScreenActor::SetDelegate(Delegate* delegate) { + screen_ = delegate; +} + +} // namespace chromeos diff --git a/chrome/browser/chromeos/login/views_eula_screen_actor.h b/chrome/browser/chromeos/login/views_eula_screen_actor.h new file mode 100644 index 000000000000..29291ab69ec3 --- /dev/null +++ b/chrome/browser/chromeos/login/views_eula_screen_actor.h @@ -0,0 +1,44 @@ +// Copyright (c) 2011 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_VIEWS_EULA_SCREEN_ACTOR_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_VIEWS_EULA_SCREEN_ACTOR_H_ +#pragma once + +#include "chrome/browser/chromeos/login/eula_screen_actor.h" +#include "chrome/browser/chromeos/login/eula_view.h" +#include "chrome/browser/chromeos/login/view_screen.h" + +namespace chromeos { + +// Views implementation of EulaScreenActor. +class ViewsEulaScreenActor : public ViewScreen, + public EulaScreenActor { + public: + explicit ViewsEulaScreenActor(WizardScreenDelegate* delegate); + virtual ~ViewsEulaScreenActor(); + + Delegate* screen() { return screen_; } + + // ViewScreen implementation. + virtual EulaView* AllocateView(); + + // EulaScreenActor implementation: + virtual void Show(); + virtual void Hide(); + virtual gfx::Size GetScreenSize() const; + virtual bool IsUsageStatsChecked() const; + virtual void SetDelegate(Delegate* delegate); + + private: + Delegate* screen_; + + DISALLOW_COPY_AND_ASSIGN(ViewsEulaScreenActor); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_VIEWS_EULA_SCREEN_ACTOR_H_ + + diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 9d94b2d83841..76c14528d904 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -22,7 +22,7 @@ #include "chrome/browser/chromeos/language_preferences.h" #include "chrome/browser/chromeos/login/account_screen.h" #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" -#include "chrome/browser/chromeos/login/eula_view.h" +#include "chrome/browser/chromeos/login/eula_screen.h" #include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/html_page_screen.h" diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 1fa166da0969..70c7297a5748 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -6,7 +6,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/login/account_screen.h" #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" -#include "chrome/browser/chromeos/login/eula_view.h" +#include "chrome/browser/chromeos/login/eula_screen.h" #include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/language_switch_menu.h" #include "chrome/browser/chromeos/login/mock_update_screen.h" diff --git a/chrome/browser/chromeos/login/wizard_screen.h b/chrome/browser/chromeos/login/wizard_screen.h index 75892b636037..bd8cd77798fa 100644 --- a/chrome/browser/chromeos/login/wizard_screen.h +++ b/chrome/browser/chromeos/login/wizard_screen.h @@ -27,6 +27,11 @@ class WizardScreenDelegate { // Returns observer screen should notify. virtual chromeos::ScreenObserver* GetObserver(WizardScreen* screen) = 0; + const chromeos::ScreenObserver* GetObserver( + const WizardScreen* screen) const { + return const_cast(this)->GetObserver( + const_cast(screen)); + } // Forces the current screen to be shown immediately. virtual void ShowCurrentScreen() = 0; @@ -51,6 +56,7 @@ class WizardScreen { virtual ~WizardScreen() {} WizardScreenDelegate* delegate() { return delegate_; } + const WizardScreenDelegate* delegate() const { return delegate_; } private: WizardScreenDelegate* delegate_; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index e02aa7686be0..c3b4360c5eac 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -489,6 +489,9 @@ 'browser/chromeos/login/enterprise_enrollment_screen.h', 'browser/chromeos/login/enterprise_enrollment_view.cc', 'browser/chromeos/login/enterprise_enrollment_view.h', + 'browser/chromeos/login/eula_screen.cc', + 'browser/chromeos/login/eula_screen.h', + 'browser/chromeos/login/eula_screen_actor.h', 'browser/chromeos/login/eula_view.cc', 'browser/chromeos/login/eula_view.h', 'browser/chromeos/login/existing_user_controller.cc', @@ -597,6 +600,8 @@ 'browser/chromeos/login/username_view.cc', 'browser/chromeos/login/username_view.h', 'browser/chromeos/login/view_screen.h', + 'browser/chromeos/login/views_eula_screen_actor.cc', + 'browser/chromeos/login/views_eula_screen_actor.h', 'browser/chromeos/login/views_login_display.cc', 'browser/chromeos/login/views_login_display.h', 'browser/chromeos/login/views_login_display_host.cc', -- 2.11.4.GIT