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

Side by Side Diff: components/sessions/core/tab_restore_service_helper.cc

Issue 2345763002: Fix tabs duplication when restoring last closed window. (Closed)
Patch Set: Fix comments. Created 4 years, 3 months 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
« no previous file with comments | « components/sessions/core/tab_restore_service_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/sessions/core/tab_restore_service_helper.h" 5 #include "components/sessions/core/tab_restore_service_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 253
254 if (!restoring_tab_in_window) { 254 if (!restoring_tab_in_window) {
255 entries_.erase(entry_iterator); 255 entries_.erase(entry_iterator);
256 } 256 }
257 257
258 restoring_ = false; 258 restoring_ = false;
259 NotifyTabsChanged(); 259 NotifyTabsChanged();
260 return live_tabs; 260 return live_tabs;
261 } 261 }
262 262
263 bool TabRestoreServiceHelper::IsRestoring() const {
264 return restoring_;
265 }
266
263 void TabRestoreServiceHelper::NotifyTabsChanged() { 267 void TabRestoreServiceHelper::NotifyTabsChanged() {
264 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_, 268 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_,
265 TabRestoreServiceChanged(tab_restore_service_)); 269 TabRestoreServiceChanged(tab_restore_service_));
266 } 270 }
267 271
268 void TabRestoreServiceHelper::NotifyLoaded() { 272 void TabRestoreServiceHelper::NotifyLoaded() {
269 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_, 273 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_,
270 TabRestoreServiceLoaded(tab_restore_service_)); 274 TabRestoreServiceLoaded(tab_restore_service_));
271 } 275 }
272 276
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 tab.browser_id = new_id; 488 tab.browser_id = new_id;
485 } 489 }
486 } 490 }
487 } 491 }
488 492
489 base::Time TabRestoreServiceHelper::TimeNow() const { 493 base::Time TabRestoreServiceHelper::TimeNow() const {
490 return time_factory_ ? time_factory_->TimeNow() : base::Time::Now(); 494 return time_factory_ ? time_factory_->TimeNow() : base::Time::Now();
491 } 495 }
492 496
493 } // namespace sessions 497 } // namespace sessions
OLDNEW
« no previous file with comments | « components/sessions/core/tab_restore_service_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698