| OLD | NEW |
| 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/sessions/tab_restore_service_helper.h" | 5 #include "chrome/browser/sessions/tab_restore_service_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 restoring_ = false; | 299 restoring_ = false; |
| 300 NotifyTabsChanged(); | 300 NotifyTabsChanged(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void TabRestoreServiceHelper::NotifyTabsChanged() { | 303 void TabRestoreServiceHelper::NotifyTabsChanged() { |
| 304 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_, | 304 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_, |
| 305 TabRestoreServiceChanged(tab_restore_service_)); | 305 TabRestoreServiceChanged(tab_restore_service_)); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void TabRestoreServiceHelper::NotifyLoaded() { |
| 309 FOR_EACH_OBSERVER(TabRestoreServiceObserver, observer_list_, |
| 310 TabRestoreServiceLoaded(tab_restore_service_)); |
| 311 } |
| 312 |
| 308 void TabRestoreServiceHelper::AddEntry(Entry* entry, | 313 void TabRestoreServiceHelper::AddEntry(Entry* entry, |
| 309 bool notify, | 314 bool notify, |
| 310 bool to_front) { | 315 bool to_front) { |
| 311 if (!FilterEntry(entry) || (entries_.size() >= kMaxEntries && !to_front)) { | 316 if (!FilterEntry(entry) || (entries_.size() >= kMaxEntries && !to_front)) { |
| 312 delete entry; | 317 delete entry; |
| 313 return; | 318 return; |
| 314 } | 319 } |
| 315 | 320 |
| 316 if (to_front) | 321 if (to_front) |
| 317 entries_.push_front(entry); | 322 entries_.push_front(entry); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 Tab* tab = static_cast<Tab*>(entry); | 566 Tab* tab = static_cast<Tab*>(entry); |
| 562 if (tab->browser_id == old_id) | 567 if (tab->browser_id == old_id) |
| 563 tab->browser_id = new_id; | 568 tab->browser_id = new_id; |
| 564 } | 569 } |
| 565 } | 570 } |
| 566 } | 571 } |
| 567 | 572 |
| 568 base::Time TabRestoreServiceHelper::TimeNow() const { | 573 base::Time TabRestoreServiceHelper::TimeNow() const { |
| 569 return time_factory_ ? time_factory_->TimeNow() : base::Time::Now(); | 574 return time_factory_ ? time_factory_->TimeNow() : base::Time::Now(); |
| 570 } | 575 } |
| OLD | NEW |