 Chromium Code Reviews
 Chromium Code Reviews Issue 2798143004:
  Fix for URL opening code  (Closed)
    
  
    Issue 2798143004:
  Fix for URL opening code  (Closed) 
  | Index: chrome/browser/sessions/session_restore.cc | 
| diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc | 
| index 49b446873dcf51153daf3469ba46dd8e84370b6c..a33ab604063eab2d5574028f78aeac6a0b349bda 100644 | 
| --- a/chrome/browser/sessions/session_restore.cc | 
| +++ b/chrome/browser/sessions/session_restore.cc | 
| @@ -277,6 +277,10 @@ class SessionRestoreImpl : public content::NotificationObserver { | 
| Profile* profile() { return profile_; } | 
| + void AddURLsToOpen(const std::vector<GURL>& urls) { | 
| + urls_to_open_.insert(urls_to_open_.end(), urls.begin(), urls.end()); | 
| + } | 
| + | 
| private: | 
| // Invoked when done with creating all the tabs/browsers. | 
| // | 
| @@ -849,5 +853,19 @@ SessionRestore::CallbackSubscription | 
| } | 
| // static | 
| +void SessionRestore::AddURLsToOpen(const Profile* profile, | 
| + const std::vector<GURL>& urls) { | 
| + for (std::set<SessionRestoreImpl*>::const_iterator it = | 
| 
Avi (use Gerrit)
2017/06/01 19:54:31
at least use for (auto it =, perhaps switch to for
 
eugenebng
2017/06/07 10:42:12
Done.
 | 
| + active_session_restorers->begin(); | 
| + it != active_session_restorers->end(); ++it) { | 
| + if ((*it)->profile() == profile) { | 
| + (*it)->AddURLsToOpen(urls); | 
| + return; | 
| + } | 
| + } | 
| + NOTREACHED() << "Failed to add urls to open for session restore"; | 
| +} | 
| + | 
| +// static | 
| base::CallbackList<void(int)>* | 
| SessionRestore::on_session_restored_callbacks_ = nullptr; |