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

Side by Side Diff: chrome/browser/ui/browser_tab_restorer.cc

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
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 11 matching lines...) Expand all
22 22
23 // BrowserTabRestorer is responsible for restoring a tab when the 23 // BrowserTabRestorer is responsible for restoring a tab when the
24 // TabRestoreService finishes loading. A TabRestoreService is associated with a 24 // TabRestoreService finishes loading. A TabRestoreService is associated with a
25 // single Browser and deletes itself if the Browser is destroyed. 25 // single Browser and deletes itself if the Browser is destroyed.
26 // BrowserTabRestorer is installed on the Profile (by way of user data), only 26 // BrowserTabRestorer is installed on the Profile (by way of user data), only
27 // one instance is created per profile at a time. 27 // one instance is created per profile at a time.
28 class BrowserTabRestorer : public TabRestoreServiceObserver, 28 class BrowserTabRestorer : public TabRestoreServiceObserver,
29 public chrome::BrowserListObserver, 29 public chrome::BrowserListObserver,
30 public base::SupportsUserData::Data { 30 public base::SupportsUserData::Data {
31 public: 31 public:
32 virtual ~BrowserTabRestorer(); 32 ~BrowserTabRestorer() override;
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 void TabRestoreServiceChanged(TabRestoreService* service) override;
41 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) override; 41 void TabRestoreServiceDestroyed(TabRestoreService* service) override;
42 virtual void TabRestoreServiceLoaded(TabRestoreService* service) override; 42 void TabRestoreServiceLoaded(TabRestoreService* service) override;
43 43
44 // BrowserListObserver: 44 // BrowserListObserver:
45 virtual void OnBrowserRemoved(Browser* browser) override; 45 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698