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