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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 777143003: Clean up straggler classes to use embedded signin in page in the new profiles world. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_restore_service.h" 10 #include "apps/app_restore_service.h"
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 // specified on the command line. 880 // specified on the command line.
881 if (startup_urls->empty()) { 881 if (startup_urls->empty()) {
882 startup_urls->push_back(GURL(chrome::kChromeUINewTabURL)); 882 startup_urls->push_back(GURL(chrome::kChromeUINewTabURL));
883 if (first_run::ShouldShowWelcomePage()) 883 if (first_run::ShouldShowWelcomePage())
884 startup_urls->push_back(internals::GetWelcomePageURL()); 884 startup_urls->push_back(internals::GetWelcomePageURL());
885 } 885 }
886 886
887 if (signin::ShouldShowPromoAtStartup(profile_, is_first_run_)) { 887 if (signin::ShouldShowPromoAtStartup(profile_, is_first_run_)) {
888 signin::DidShowPromoAtStartup(profile_); 888 signin::DidShowPromoAtStartup(profile_);
889 889
890 const GURL sync_promo_url = signin::GetPromoURL(signin::SOURCE_START_PAGE, 890 const GURL sync_promo_url = signin::GetPromoURL(
891 false); 891 signin_metrics::SOURCE_START_PAGE, false);
892 892
893 // No need to add if the sync promo is already in the startup list. 893 // No need to add if the sync promo is already in the startup list.
894 bool add_promo = true; 894 bool add_promo = true;
895 for (std::vector<GURL>::const_iterator it = startup_urls->begin(); 895 for (std::vector<GURL>::const_iterator it = startup_urls->begin();
896 it != startup_urls->end(); ++it) { 896 it != startup_urls->end(); ++it) {
897 if (*it == sync_promo_url) { 897 if (*it == sync_promo_url) {
898 add_promo = false; 898 add_promo = false;
899 break; 899 break;
900 } 900 }
901 } 901 }
902 902
903 if (add_promo) { 903 if (add_promo) {
904 // If the first URL is the NTP, replace it with the sync promo. This 904 // If the first URL is the NTP, replace it with the sync promo. This
905 // behavior is desired because completing or skipping the sync promo 905 // behavior is desired because completing or skipping the sync promo
906 // causes a redirect to the NTP. 906 // causes a redirect to the NTP.
907 if (!startup_urls->empty() && 907 if (!startup_urls->empty() &&
908 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) 908 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL))
909 startup_urls->at(0) = sync_promo_url; 909 startup_urls->at(0) = sync_promo_url;
910 else 910 else
911 startup_urls->insert(startup_urls->begin(), sync_promo_url); 911 startup_urls->insert(startup_urls->begin(), sync_promo_url);
912 } 912 }
913 } 913 }
914 } 914 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_browsertest.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698