diff options
author | cylee@chromium.org <cylee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 22:14:08 +0000 |
---|---|---|
committer | cylee@chromium.org <cylee@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-07 22:14:08 +0000 |
commit | 3a76bda6f7b016de0ff970f876fda28b0b9f2703 (patch) | |
tree | 03c24a09e8e3a89ad7450430af78a059ce88da10 | |
parent | 59fa29fb68df7d23cf6ec69a91894e63553cfe41 (diff) | |
download | chromium_src-3a76bda6f7b016de0ff970f876fda28b0b9f2703.zip chromium_src-3a76bda6f7b016de0ff970f876fda28b0b9f2703.tar.gz chromium_src-3a76bda6f7b016de0ff970f876fda28b0b9f2703.tar.bz2 |
1. Open HelpApp instead of go to Get Started web url on OOBE.
2. Modify manifest.json of HelpApp.
3. Remove gsg entry in NTP.
BUG=162150
Review URL: https://chromiumcodereview.appspot.com/11316131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171860 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/login/existing_user_controller.cc | 60 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/existing_user_controller.h | 3 | ||||
-rw-r--r-- | chrome/browser/history/top_sites.cc | 37 | ||||
-rw-r--r-- | chrome/browser/resources/help_app/manifest.json | 4 |
4 files changed, 24 insertions, 80 deletions
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 511ba76..01c2a62 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -70,13 +70,18 @@ const char kSettingsSyncLoginURL[] = "chrome://settings/personal"; // Major version where we still show GSG as "Release Notes" after the update. const long int kReleaseNotesTargetRelease = 19; -// Getting started guide URL, will be opened as in app window for each new +// Getting started guide url, will be opened as in app window for each new // user who logs on the device. -const char kGetStartedURLPattern[] = - "http://gweb-gettingstartedguide.appspot.com/"; +// It actually goes to HelpApp and get redirected to our actual server there. +const char kGetStartedWebUrl[] = +#if defined(OFFICIAL_BUILD) + "chrome-extension://honijodknafkokifofgiaalefdiedpko/gsg.html?oobe=1"; +#else + "https://gweb-gettingstartedguide.appspot.com/"; +#endif // defined(OFFICIAL_BUILD) // Getting started guide application window size. -const char kGSGAppWindowSize[] = "820,550"; +const char kGSGAppWindowSize[] = "820,600"; // Parameter to be added to GetStarted URL that contains board. const char kGetStartedBoardParam[] = "board"; @@ -844,11 +849,10 @@ gfx::NativeWindow ExistingUserController::GetNativeWindow() const { void ExistingUserController::InitializeStartUrls() const { std::vector<std::string> start_urls; - // Guide URL is not added to start URLs as it should be passed as an app. - std::string guide_url; PrefService* prefs = g_browser_process->local_state(); const base::ListValue *urls; + bool show_getstarted_guide = false; if (UserManager::Get()->IsLoggedInAsDemoUser()) { if (CrosSettings::Get()->GetList(kStartUpUrls, &urls)) { // The retail mode user will get start URLs from a special policy if it is @@ -868,7 +872,7 @@ void ExistingUserController::InitializeStartUrls() const { std::string vox_url = base::StringPrintf(url, current_locale.c_str()); start_urls.push_back(vox_url); } else { - guide_url = GetGettingStartedGuideURL(); + show_getstarted_guide = true; } } @@ -880,9 +884,9 @@ void ExistingUserController::InitializeStartUrls() const { customization->ApplyCustomization(); } - if (!guide_url.empty()) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kApp, - guide_url); + if (show_getstarted_guide) { + CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kApp, kGetStartedWebUrl); CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppWindowSize, kGSGAppWindowSize); } else { @@ -893,33 +897,6 @@ void ExistingUserController::InitializeStartUrls() const { } } -std::string ExistingUserController::GetGettingStartedGuideURL() const { - GURL guide_url(kGetStartedURLPattern); - std::string board; - const char kMachineInfoBoard[] = "CHROMEOS_RELEASE_BOARD"; - system::StatisticsProvider* provider = - system::StatisticsProvider::GetInstance(); - if (!provider->GetMachineStatistic(kMachineInfoBoard, &board)) - LOG(ERROR) << "Failed to get board information"; - if (!board.empty()) { - guide_url = chrome_common_net::AppendQueryParameter(guide_url, - kGetStartedBoardParam, - board); - } - if (is_owner_login_) { - guide_url = chrome_common_net::AppendQueryParameter( - guide_url, - kGetStartedOwnerParam, - kGetStartedOwnerParamValue); - } - guide_url = google_util::AppendGoogleLocaleParam(guide_url); - guide_url = chrome_common_net::AppendQueryParameter( - guide_url, - kGetStartedInitialLocaleParam, - WizardController::GetInitialLocale()); - return guide_url.spec(); -} - void ExistingUserController::OptionallyShowReleaseNotes( Profile* profile) const { // TODO(nkostylev): Fix WizardControllerFlowTest case. @@ -958,13 +935,12 @@ void ExistingUserController::OptionallyShowReleaseNotes( // Otherwise, trigger on major version change. if (current_version.components()[0] > prev_version.components()[0]) { - std::string release_notes_url = GetGettingStartedGuideURL(); - if (!release_notes_url.empty()) { - CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kApp, - release_notes_url); + CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kApp, kGetStartedWebUrl); + CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kAppWindowSize, kGSGAppWindowSize); prefs->SetString(prefs::kChromeOSReleaseNotesVersion, current_version.GetString()); - } } } diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index 85c14c4..18d90e4 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h @@ -63,9 +63,6 @@ class ExistingUserController : public LoginDisplay::Delegate, // Tells the controller to resume a pending login. void ResumeLogin(); - // Returns Getting Started Guide URL with parameters. - std::string GetGettingStartedGuideURL() const; - // LoginDisplay::Delegate: implementation virtual void CreateAccount() OVERRIDE; virtual string16 GetConnectedNetworkName() OVERRIDE; diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index fd95a02..d4d3779 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -45,10 +45,6 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image_util.h" -#if defined(OS_CHROMEOS) -#include "chrome/browser/chromeos/login/existing_user_controller.h" -#endif - using base::DictionaryValue; using content::BrowserThread; using content::NavigationController; @@ -88,11 +84,7 @@ static const int64 kMaxUpdateIntervalMinutes = 60; static const int kTopSitesImageQuality = 100; const TopSites::PrepopulatedPage kPrepopulatedPages[] = { -#if defined(OS_CHROMEOS) - { IDS_CHROMEOS_WELCOME_URL, IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE, - IDR_PRODUCT_LOGO_16, IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL, - SkColorSetRGB(0, 147, 60) }, -#elif defined(OS_ANDROID) +#if defined(OS_ANDROID) { IDS_MOBILE_WELCOME_URL, IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE, IDR_PRODUCT_LOGO_16, IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL, SkColorSetRGB(0, 147, 60) } @@ -172,26 +164,6 @@ class LoadThumbnailsFromHistoryTask : public HistoryDBTask { DISALLOW_COPY_AND_ASSIGN(LoadThumbnailsFromHistoryTask); }; -// Adds overridden URL to the given vector and returns true if the given -// |url_id| needs to be overridden. Otherwise, does nothing but returns false. -bool MaybeOverrideUrl(int url_id, std::vector<GURL>* prepopulated_page_urls) { -#if defined(OS_CHROMEOS) - if (url_id == IDS_CHROMEOS_WELCOME_URL) { - std::string getting_started_guide_url; - if (chromeos::ExistingUserController::current_controller()) { - getting_started_guide_url = - chromeos::ExistingUserController::current_controller()-> - GetGettingStartedGuideURL(); - } - if (!getting_started_guide_url.empty()) { - prepopulated_page_urls->push_back(GURL(getting_started_guide_url)); - return true; - } - } -#endif - return false; -} - } // namespace TopSites::TopSites(Profile* profile) @@ -214,13 +186,10 @@ TopSites::TopSites(Profile* profile) registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); } - for (size_t i = 0; i < arraysize(kPrepopulatedPages); i++) { int url_id = kPrepopulatedPages[i].url_id; - if (!MaybeOverrideUrl(url_id, &prepopulated_page_urls_)) { - prepopulated_page_urls_.push_back( - GURL(l10n_util::GetStringUTF8(url_id))); - } + prepopulated_page_urls_.push_back( + GURL(l10n_util::GetStringUTF8(url_id))); } } diff --git a/chrome/browser/resources/help_app/manifest.json b/chrome/browser/resources/help_app/manifest.json index 90ed05b..1940a63 100644 --- a/chrome/browser/resources/help_app/manifest.json +++ b/chrome/browser/resources/help_app/manifest.json @@ -7,7 +7,9 @@ "incognito": "split", "permissions": [ "tabs", + "management", "https://support.google.com/chromeos/*/*", + "https://gweb-gettingstartedguide.appspot.com/*", "chromeosInfoPrivate" ], "content_scripts": [ @@ -19,5 +21,5 @@ } ], "manifest_version": 2, - "content_security_policy": "default-src 'self'; script-src 'self' https://ssl.google-analytics.com; object-src 'none'; img-src 'self' http://www.google-analytics.com; frame-src https://support.google.com; connect-src https://support.google.com; style-src 'self' 'unsafe-inline'" + "content_security_policy": "default-src 'self'; script-src 'self' https://ssl.google-analytics.com; object-src 'none'; img-src 'self' http://www.google-analytics.com; frame-src https://support.google.com; connect-src https://support.google.com https://gweb-gettingstartedguide.appspot.com; style-src 'self' 'unsafe-inline'" } |