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

Side by Side Diff: chrome/browser/ui/browser_tab_restore_service_delegate.h

Issue 1321713005: Abstract WebContents/NavigationController from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 5 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
OLDNEW
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 #ifndef CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_
6 #define CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "chrome/browser/sessions/tab_restore_service_delegate.h" 12 #include "chrome/browser/sessions/tab_restore_service_delegate.h"
13 #include "chrome/browser/ui/host_desktop.h" 13 #include "chrome/browser/ui/host_desktop.h"
14 14
15 class Browser; 15 class Browser;
16 class Profile; 16 class Profile;
17 17
18 namespace content {
19 class WebContents;
20 }
21
18 // Implementation of TabRestoreServiceDelegate which uses an instance of 22 // Implementation of TabRestoreServiceDelegate which uses an instance of
19 // Browser in order to fulfil its duties. 23 // Browser in order to fulfil its duties.
20 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate { 24 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate {
21 public: 25 public:
22 explicit BrowserTabRestoreServiceDelegate(Browser* browser) 26 explicit BrowserTabRestoreServiceDelegate(Browser* browser)
23 : browser_(browser) {} 27 : browser_(browser) {}
24 ~BrowserTabRestoreServiceDelegate() override {} 28 ~BrowserTabRestoreServiceDelegate() override {}
25 29
26 // Overridden from TabRestoreServiceDelegate: 30 // Overridden from TabRestoreServiceDelegate:
27 void ShowBrowserWindow() override; 31 void ShowBrowserWindow() override;
28 const SessionID& GetSessionID() const override; 32 const SessionID& GetSessionID() const override;
29 int GetTabCount() const override; 33 int GetTabCount() const override;
30 int GetSelectedIndex() const override; 34 int GetSelectedIndex() const override;
31 std::string GetAppName() const override; 35 std::string GetAppName() const override;
32 content::WebContents* GetWebContentsAt(int index) const override; 36 sessions::LiveTab* GetLiveTabAt(int index) const override;
33 content::WebContents* GetActiveWebContents() const override; 37 sessions::LiveTab* GetActiveLiveTab() const override;
34 bool IsTabPinned(int index) const override; 38 bool IsTabPinned(int index) const override;
35 content::WebContents* AddRestoredTab( 39 sessions::LiveTab* AddRestoredTab(
36 const std::vector<sessions::SerializedNavigationEntry>& navigations, 40 const std::vector<sessions::SerializedNavigationEntry>& navigations,
37 int tab_index, 41 int tab_index,
38 int selected_navigation, 42 int selected_navigation,
39 const std::string& extension_app_id, 43 const std::string& extension_app_id,
40 bool select, 44 bool select,
41 bool pin, 45 bool pin,
42 bool from_last_session, 46 bool from_last_session,
43 const sessions::TabClientData* storage_namespace, 47 const sessions::TabClientData* storage_namespace,
44 const std::string& user_agent_override) override; 48 const std::string& user_agent_override) override;
45 content::WebContents* ReplaceRestoredTab( 49 sessions::LiveTab* ReplaceRestoredTab(
46 const std::vector<sessions::SerializedNavigationEntry>& navigations, 50 const std::vector<sessions::SerializedNavigationEntry>& navigations,
47 int selected_navigation, 51 int selected_navigation,
48 bool from_last_session, 52 bool from_last_session,
49 const std::string& extension_app_id, 53 const std::string& extension_app_id,
50 const sessions::TabClientData* tab_client_data, 54 const sessions::TabClientData* tab_client_data,
51 const std::string& user_agent_override) override; 55 const std::string& user_agent_override) override;
52 void CloseTab() override; 56 void CloseTab() override;
53 57
54 // see Browser::Create 58 // see Browser::Create
55 static TabRestoreServiceDelegate* Create( 59 static TabRestoreServiceDelegate* Create(
(...skipping 12 matching lines...) Expand all
68 SessionID::id_type desired_id, 72 SessionID::id_type desired_id,
69 chrome::HostDesktopType host_desktop_type); 73 chrome::HostDesktopType host_desktop_type);
70 74
71 private: 75 private:
72 Browser* browser_; 76 Browser* browser_;
73 77
74 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate); 78 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate);
75 }; 79 };
76 80
77 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ 81 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sessions/tab_restore_service_helper.cc ('k') | chrome/browser/ui/browser_tab_restore_service_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698