| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 12 |
| 13 class NavigationController; | 13 class NavigationController; |
| 14 class Profile; | 14 class Profile; |
| 15 class SessionStorageNamespace; | 15 class SessionStorageNamespace; |
| 16 class TabContents; | 16 class TabContents; |
| 17 class TabNavigation; | 17 class TabNavigation; |
| 18 | 18 |
| 19 namespace content { |
| 20 class WebContents; |
| 21 } |
| 22 |
| 19 // Objects implement this interface to provide necessary functionality for | 23 // Objects implement this interface to provide necessary functionality for |
| 20 // TabRestoreService to operate. These methods are mostly copies of existing | 24 // TabRestoreService to operate. These methods are mostly copies of existing |
| 21 // Browser methods. | 25 // Browser methods. |
| 22 class TabRestoreServiceDelegate { | 26 class TabRestoreServiceDelegate { |
| 23 public: | 27 public: |
| 24 // see BrowserWindow::Show() | 28 // see BrowserWindow::Show() |
| 25 virtual void ShowBrowserWindow() = 0; | 29 virtual void ShowBrowserWindow() = 0; |
| 26 | 30 |
| 27 // see Browser::session_id() | 31 // see Browser::session_id() |
| 28 virtual const SessionID& GetSessionID() const = 0; | 32 virtual const SessionID& GetSessionID() const = 0; |
| 29 | 33 |
| 30 // see Browser::tab_count() | 34 // see Browser::tab_count() |
| 31 virtual int GetTabCount() const = 0; | 35 virtual int GetTabCount() const = 0; |
| 32 | 36 |
| 33 // see Browser::active_index() | 37 // see Browser::active_index() |
| 34 virtual int GetSelectedIndex() const = 0; | 38 virtual int GetSelectedIndex() const = 0; |
| 35 | 39 |
| 36 // see Browser methods with the same names | 40 // see Browser methods with the same names |
| 37 virtual TabContents* GetTabContentsAt(int index) const = 0; | 41 virtual TabContents* GetTabContentsAt(int index) const = 0; |
| 38 virtual TabContents* GetSelectedTabContents() const = 0; | 42 virtual content::WebContents* GetSelectedWebContents() const = 0; |
| 39 virtual bool IsTabPinned(int index) const = 0; | 43 virtual bool IsTabPinned(int index) const = 0; |
| 40 virtual TabContents* AddRestoredTab( | 44 virtual TabContents* AddRestoredTab( |
| 41 const std::vector<TabNavigation>& navigations, | 45 const std::vector<TabNavigation>& navigations, |
| 42 int tab_index, | 46 int tab_index, |
| 43 int selected_navigation, | 47 int selected_navigation, |
| 44 const std::string& extension_app_id, | 48 const std::string& extension_app_id, |
| 45 bool select, | 49 bool select, |
| 46 bool pin, | 50 bool pin, |
| 47 bool from_last_session, | 51 bool from_last_session, |
| 48 SessionStorageNamespace* storage_namespace) = 0; | 52 SessionStorageNamespace* storage_namespace) = 0; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 | 68 |
| 65 // see BrowserList::FindBrowserWithID | 69 // see BrowserList::FindBrowserWithID |
| 66 static TabRestoreServiceDelegate* FindDelegateWithID( | 70 static TabRestoreServiceDelegate* FindDelegateWithID( |
| 67 SessionID::id_type desired_id); | 71 SessionID::id_type desired_id); |
| 68 | 72 |
| 69 protected: | 73 protected: |
| 70 virtual ~TabRestoreServiceDelegate() {} | 74 virtual ~TabRestoreServiceDelegate() {} |
| 71 }; | 75 }; |
| 72 | 76 |
| 73 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | 77 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ |
| OLD | NEW |