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_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 | 13 |
14 class Browser; | 14 class Browser; |
15 class SessionStorageNamespace; | |
16 class TabContents; | |
17 class TabNavigation; | |
18 | 15 |
19 // Implementation of TabRestoreServiceDelegate which uses an instance of | 16 // Implementation of TabRestoreServiceDelegate which uses an instance of |
20 // Browser in order to fulfil its duties. | 17 // Browser in order to fulfil its duties. |
21 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate { | 18 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate { |
22 public: | 19 public: |
23 explicit BrowserTabRestoreServiceDelegate(Browser* browser) | 20 explicit BrowserTabRestoreServiceDelegate(Browser* browser) |
24 : browser_(browser) {} | 21 : browser_(browser) {} |
25 virtual ~BrowserTabRestoreServiceDelegate() {} | 22 virtual ~BrowserTabRestoreServiceDelegate() {} |
26 | 23 |
27 // Overridden from TabRestoreServiceDelegate: | 24 // Overridden from TabRestoreServiceDelegate: |
28 virtual void ShowBrowserWindow() OVERRIDE; | 25 virtual void ShowBrowserWindow() OVERRIDE; |
29 virtual const SessionID& GetSessionID() const OVERRIDE; | 26 virtual const SessionID& GetSessionID() const OVERRIDE; |
30 virtual int GetTabCount() const OVERRIDE; | 27 virtual int GetTabCount() const OVERRIDE; |
31 virtual int GetSelectedIndex() const OVERRIDE; | 28 virtual int GetSelectedIndex() const OVERRIDE; |
32 virtual TabContents* GetTabContentsAt(int index) const OVERRIDE; | 29 virtual TabContents* GetTabContentsAt(int index) const OVERRIDE; |
33 virtual TabContents* GetSelectedTabContents() const OVERRIDE; | 30 virtual content::WebContents* GetSelectedWebContents() const OVERRIDE; |
34 virtual bool IsTabPinned(int index) const OVERRIDE; | 31 virtual bool IsTabPinned(int index) const OVERRIDE; |
35 virtual TabContents* AddRestoredTab( | 32 virtual TabContents* AddRestoredTab( |
36 const std::vector<TabNavigation>& navigations, | 33 const std::vector<TabNavigation>& navigations, |
37 int tab_index, | 34 int tab_index, |
38 int selected_navigation, | 35 int selected_navigation, |
39 const std::string& extension_app_id, | 36 const std::string& extension_app_id, |
40 bool select, | 37 bool select, |
41 bool pin, | 38 bool pin, |
42 bool from_last_session, | 39 bool from_last_session, |
43 SessionStorageNamespace* storage_namespace) OVERRIDE; | 40 SessionStorageNamespace* storage_namespace) OVERRIDE; |
44 virtual void ReplaceRestoredTab( | 41 virtual void ReplaceRestoredTab( |
45 const std::vector<TabNavigation>& navigations, | 42 const std::vector<TabNavigation>& navigations, |
46 int selected_navigation, | 43 int selected_navigation, |
47 bool from_last_session, | 44 bool from_last_session, |
48 const std::string& extension_app_id, | 45 const std::string& extension_app_id, |
49 SessionStorageNamespace* session_storage_namespace) OVERRIDE; | 46 SessionStorageNamespace* session_storage_namespace) OVERRIDE; |
50 virtual void CloseTab() OVERRIDE; | 47 virtual void CloseTab() OVERRIDE; |
51 | 48 |
52 private: | 49 private: |
53 Browser* browser_; | 50 Browser* browser_; |
54 | 51 |
55 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate); | 52 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate); |
56 }; | 53 }; |
57 | 54 |
58 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ | 55 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_ |
OLD | NEW |