OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/metrics/user_metrics_action.h" | 5 #include "base/metrics/user_metrics_action.h" |
6 #include "base/supports_user_data.h" | 6 #include "base/supports_user_data.h" |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/sessions/tab_restore_service.h" | 8 #include "chrome/browser/sessions/tab_restore_service.h" |
9 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 9 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
10 #include "chrome/browser/sessions/tab_restore_service_observer.h" | 10 #include "chrome/browser/sessions/tab_restore_service_observer.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 public base::SupportsUserData::Data { | 30 public base::SupportsUserData::Data { |
31 public: | 31 public: |
32 virtual ~BrowserTabRestorer(); | 32 virtual ~BrowserTabRestorer(); |
33 | 33 |
34 static void CreateIfNecessary(Browser* browser); | 34 static void CreateIfNecessary(Browser* browser); |
35 | 35 |
36 private: | 36 private: |
37 explicit BrowserTabRestorer(Browser* browser); | 37 explicit BrowserTabRestorer(Browser* browser); |
38 | 38 |
39 // TabRestoreServiceObserver: | 39 // TabRestoreServiceObserver: |
40 virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE; | 40 virtual void TabRestoreServiceChanged(TabRestoreService* service) override; |
41 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) OVERRIDE; | 41 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) override; |
42 virtual void TabRestoreServiceLoaded(TabRestoreService* service) OVERRIDE; | 42 virtual void TabRestoreServiceLoaded(TabRestoreService* service) override; |
43 | 43 |
44 // BrowserListObserver: | 44 // BrowserListObserver: |
45 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; | 45 virtual void OnBrowserRemoved(Browser* browser) override; |
46 | 46 |
47 Browser* browser_; | 47 Browser* browser_; |
48 TabRestoreService* tab_restore_service_; | 48 TabRestoreService* tab_restore_service_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestorer); | 50 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestorer); |
51 }; | 51 }; |
52 | 52 |
53 BrowserTabRestorer::~BrowserTabRestorer() { | 53 BrowserTabRestorer::~BrowserTabRestorer() { |
54 tab_restore_service_->RemoveObserver(this); | 54 tab_restore_service_->RemoveObserver(this); |
55 BrowserList::GetInstance(browser_->host_desktop_type())->RemoveObserver(this); | 55 BrowserList::GetInstance(browser_->host_desktop_type())->RemoveObserver(this); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (service->IsLoaded()) { | 107 if (service->IsLoaded()) { |
108 service->RestoreMostRecentEntry(browser->tab_restore_service_delegate(), | 108 service->RestoreMostRecentEntry(browser->tab_restore_service_delegate(), |
109 browser->host_desktop_type()); | 109 browser->host_desktop_type()); |
110 return; | 110 return; |
111 } | 111 } |
112 | 112 |
113 BrowserTabRestorer::CreateIfNecessary(browser); | 113 BrowserTabRestorer::CreateIfNecessary(browser); |
114 } | 114 } |
115 | 115 |
116 } // namespace chrome | 116 } // namespace chrome |
OLD | NEW |