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 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ |
6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | 6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/sessions/session_id.h" | 11 #include "chrome/browser/sessions/session_id.h" |
| 12 #include "content/public/browser/navigation_controller.h" |
12 | 13 |
13 class Profile; | 14 class Profile; |
14 class TabNavigation; | 15 class TabNavigation; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class NavigationController; | |
18 class SessionStorageNamespace; | |
19 class WebContents; | 18 class WebContents; |
20 } | 19 } |
21 | 20 |
22 // Objects implement this interface to provide necessary functionality for | 21 // Objects implement this interface to provide necessary functionality for |
23 // TabRestoreService to operate. These methods are mostly copies of existing | 22 // TabRestoreService to operate. These methods are mostly copies of existing |
24 // Browser methods. | 23 // Browser methods. |
25 class TabRestoreServiceDelegate { | 24 class TabRestoreServiceDelegate { |
26 public: | 25 public: |
27 // see BrowserWindow::Show() | 26 // see BrowserWindow::Show() |
28 virtual void ShowBrowserWindow() = 0; | 27 virtual void ShowBrowserWindow() = 0; |
(...skipping 15 matching lines...) Expand all Loading... |
44 virtual content::WebContents* GetActiveWebContents() const = 0; | 43 virtual content::WebContents* GetActiveWebContents() const = 0; |
45 virtual bool IsTabPinned(int index) const = 0; | 44 virtual bool IsTabPinned(int index) const = 0; |
46 virtual content::WebContents* AddRestoredTab( | 45 virtual content::WebContents* AddRestoredTab( |
47 const std::vector<TabNavigation>& navigations, | 46 const std::vector<TabNavigation>& navigations, |
48 int tab_index, | 47 int tab_index, |
49 int selected_navigation, | 48 int selected_navigation, |
50 const std::string& extension_app_id, | 49 const std::string& extension_app_id, |
51 bool select, | 50 bool select, |
52 bool pin, | 51 bool pin, |
53 bool from_last_session, | 52 bool from_last_session, |
54 content::SessionStorageNamespace* storage_namespace, | 53 const content::SessionStorageNamespaceMap& storage_namespace_map, |
55 const std::string& user_agent_override) = 0; | 54 const std::string& user_agent_override) = 0; |
56 virtual void ReplaceRestoredTab( | 55 virtual void ReplaceRestoredTab( |
57 const std::vector<TabNavigation>& navigations, | 56 const std::vector<TabNavigation>& navigations, |
58 int selected_navigation, | 57 int selected_navigation, |
59 bool from_last_session, | 58 bool from_last_session, |
60 const std::string& extension_app_id, | 59 const std::string& extension_app_id, |
61 content::SessionStorageNamespace* session_storage_namespace, | 60 const content::SessionStorageNamespaceMap& storage_namespace_map, |
62 const std::string& user_agent_override) = 0; | 61 const std::string& user_agent_override) = 0; |
63 virtual void CloseTab() = 0; | 62 virtual void CloseTab() = 0; |
64 | 63 |
65 // see Browser::Create | 64 // see Browser::Create |
66 static TabRestoreServiceDelegate* Create(Profile* profile, | 65 static TabRestoreServiceDelegate* Create(Profile* profile, |
67 const std::string& app_name); | 66 const std::string& app_name); |
68 | 67 |
69 // see browser::FindBrowserForWebContents | 68 // see browser::FindBrowserForWebContents |
70 static TabRestoreServiceDelegate* FindDelegateForWebContents( | 69 static TabRestoreServiceDelegate* FindDelegateForWebContents( |
71 const content::WebContents* contents); | 70 const content::WebContents* contents); |
72 | 71 |
73 // see browser::FindBrowserWithID | 72 // see browser::FindBrowserWithID |
74 static TabRestoreServiceDelegate* FindDelegateWithID( | 73 static TabRestoreServiceDelegate* FindDelegateWithID( |
75 SessionID::id_type desired_id); | 74 SessionID::id_type desired_id); |
76 | 75 |
77 protected: | 76 protected: |
78 virtual ~TabRestoreServiceDelegate() {} | 77 virtual ~TabRestoreServiceDelegate() {} |
79 }; | 78 }; |
80 | 79 |
81 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | 80 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ |
OLD | NEW |