Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/sessions/tab_restore_service_delegate.h

Issue 6660028: Decouple TabRestoreService from Browser (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 "chrome/browser/sessions/session_id.h"
9
10 class BrowserWindow;
11 class Profile;
12 class SessionStorageNamespace;
13 class TabContents;
14 class TabNavigation;
15 class TabRestoreService;
16
17 // Objects implement this interface to provide necessary functionality for
18 // TabRestoreService to operate.
19 class TabRestoreServiceDelegate {
20 public:
21 virtual bool IsNormalBrowser() const = 0;
sky 2011/03/10 18:43:24 Remove this and instead push the code into the cal
torne_google.com 2011/03/11 15:07:12 Done.
22 virtual Profile* profile() const = 0;
Ben Goodger (Google) 2011/03/10 18:28:35 Google style: virtual methods should never use uni
sky 2011/03/10 18:43:24 This shouldn't be necessary as TabRestoreService (
torne_google.com 2011/03/11 15:07:12 Done.
23 virtual BrowserWindow* window() const = 0;
sky 2011/03/10 18:43:24 If we're trying to minimize the surface area TabRe
torne_google.com 2011/03/11 15:07:12 Done.
24 virtual const SessionID& session_id() const = 0;
25 virtual int tab_count() const = 0;
26 virtual int selected_index() const = 0;
27 virtual int GetIndexOfController(
sky 2011/03/10 18:43:24 This shouldn't be needed. I believe the index can
torne_google.com 2011/03/11 15:07:12 Done.
28 const NavigationController* controller) const = 0;
Ben Goodger (Google) 2011/03/10 18:28:35 Code other than tab-restore related code calls thi
29 virtual TabContents* GetTabContentsAt(int index) const = 0;
30 virtual TabContents* GetSelectedTabContents() const = 0;
Ben Goodger (Google) 2011/03/10 18:28:35 Same comment as above with most of these methods.
torne_google.com 2011/03/11 15:07:12 tab_count, GetTabContentsAt are used to iterate ov
31 virtual bool IsTabPinned(int index) const = 0;
32 virtual TabContents* AddRestoredTab(
33 const std::vector<TabNavigation>& navigations,
34 int tab_index,
35 int selected_navigation,
36 const std::string& extension_app_id,
37 bool select,
38 bool pin,
39 bool from_last_session,
40 SessionStorageNamespace* storage_namespace) = 0;
Ben Goodger (Google) 2011/03/10 18:28:35 This seems like a valid method to define on such a
41 virtual void ReplaceRestoredTab(
42 const std::vector<TabNavigation>& navigations,
43 int selected_navigation,
44 bool from_last_session,
45 const std::string& extension_app_id,
46 SessionStorageNamespace* session_storage_namespace) = 0;
Ben Goodger (Google) 2011/03/10 18:28:35 So does this.
47 virtual void CloseTab() = 0;
Ben Goodger (Google) 2011/03/10 18:28:35 This... not as much.
torne_google.com 2011/03/11 15:07:12 This is used in the case where the current tab is
48
49 static TabRestoreServiceDelegate* Create(Profile* profile);
50 static TabRestoreServiceDelegate* GetBrowserForController(
51 const NavigationController* controller, int* index);
52 static TabRestoreServiceDelegate* FindBrowserWithID(
53 SessionID::id_type desired_id);
54
55 protected:
56 virtual ~TabRestoreServiceDelegate() {}
57 };
58
59 #endif // CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698