Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | |
| 6 #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "chrome/browser/sessions/session_id.h" | |
| 12 | |
| 13 class BrowserWindow; | |
| 14 class Profile; | |
| 15 class SessionStorageNamespace; | |
| 16 class TabContents; | |
| 17 class TabNavigation; | |
| 18 class TabRestoreService; | |
| 19 | |
| 20 // Objects implement this interface to provide necessary functionality for | |
| 21 // TabRestoreService to operate. These methods are mostly copies of existing | |
| 22 // Browser methods. | |
| 23 class TabRestoreServiceDelegate { | |
| 24 public: | |
| 25 // see BrowserWindow::Show() | |
| 26 virtual void ShowBrowserWindow() = 0; | |
| 27 | |
| 28 // see Browser::session_id() | |
| 29 virtual const SessionID& GetSessionID() const = 0; | |
| 30 | |
| 31 // see Browser::tab_count() | |
| 32 virtual int GetTabCount() const = 0; | |
| 33 | |
| 34 // see Browser::selected_index() | |
| 35 virtual int GetSelectedIndex() const = 0; | |
| 36 | |
| 37 // see Browser methods with the same names | |
| 38 virtual TabContents* GetTabContentsAt(int index) const = 0; | |
| 39 virtual TabContents* GetSelectedTabContents() const = 0; | |
| 40 virtual bool IsTabPinned(int index) const = 0; | |
| 41 virtual TabContents* AddRestoredTab( | |
| 42 const std::vector<TabNavigation>& navigations, | |
| 43 int tab_index, | |
| 44 int selected_navigation, | |
| 45 const std::string& extension_app_id, | |
| 46 bool select, | |
| 47 bool pin, | |
| 48 bool from_last_session, | |
| 49 SessionStorageNamespace* storage_namespace) = 0; | |
| 50 virtual void ReplaceRestoredTab( | |
| 51 const std::vector<TabNavigation>& navigations, | |
| 52 int selected_navigation, | |
| 53 bool from_last_session, | |
| 54 const std::string& extension_app_id, | |
| 55 SessionStorageNamespace* session_storage_namespace) = 0; | |
| 56 virtual void CloseTab() = 0; | |
| 57 | |
| 58 | |
|
sky
2011/03/11 17:40:37
Nuke one of these lines.
torne_google.com
2011/03/14 15:07:25
Done.
| |
| 59 virtual ~TabRestoreServiceDelegate() {} | |
|
sky
2011/03/11 17:40:37
destructor should be protected.
torne_google.com
2011/03/14 15:07:25
Why? Browser's scoped_ptr can't destroy the object
sky
2011/03/14 15:26:21
To make it clear TabRestoreService doesn't own the
| |
| 60 | |
| 61 // see Browser::Create | |
| 62 static TabRestoreServiceDelegate* CreateBrowser(Profile* profile); | |
|
sky
2011/03/11 17:40:37
CreateBrowser -> Create
torne_google.com
2011/03/14 15:07:25
Done.
| |
| 63 | |
| 64 // see BrowserList::GetBrowserForController | |
| 65 static TabRestoreServiceDelegate* GetBrowserForController( | |
| 66 const NavigationController* controller, int* index); | |
|
sky
2011/03/11 17:40:37
wrap int* onto its own line. Also, name this FindD
torne_google.com
2011/03/14 15:07:25
Done.
| |
| 67 | |
| 68 // see BrowserList::FindBrowserWithID | |
| 69 static TabRestoreServiceDelegate* FindBrowserWithID( | |
|
sky
2011/03/11 17:40:37
FindDelegateWithID
torne_google.com
2011/03/14 15:07:25
Done.
| |
| 70 SessionID::id_type desired_id); | |
| 71 }; | |
| 72 | |
| 73 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_ | |
| OLD | NEW |