Add ability to gather metrics to BubbleManager.
[chromium-blink-merge.git] / chrome / browser / ui / browser_tab_restore_service_delegate.h
blob215104f5243a0fe82a7572f723f5b76ad203bb15
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_
6 #define CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_
8 #include <string>
9 #include <vector>
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/sessions/tab_restore_service_delegate.h"
14 class Browser;
16 // Implementation of TabRestoreServiceDelegate which uses an instance of
17 // Browser in order to fulfil its duties.
18 class BrowserTabRestoreServiceDelegate : public TabRestoreServiceDelegate {
19 public:
20 explicit BrowserTabRestoreServiceDelegate(Browser* browser)
21 : browser_(browser) {}
22 ~BrowserTabRestoreServiceDelegate() override {}
24 // Overridden from TabRestoreServiceDelegate:
25 void ShowBrowserWindow() override;
26 const SessionID& GetSessionID() const override;
27 int GetTabCount() const override;
28 int GetSelectedIndex() const override;
29 std::string GetAppName() const override;
30 content::WebContents* GetWebContentsAt(int index) const override;
31 content::WebContents* GetActiveWebContents() const override;
32 bool IsTabPinned(int index) const override;
33 content::WebContents* AddRestoredTab(
34 const std::vector<sessions::SerializedNavigationEntry>& navigations,
35 int tab_index,
36 int selected_navigation,
37 const std::string& extension_app_id,
38 bool select,
39 bool pin,
40 bool from_last_session,
41 content::SessionStorageNamespace* storage_namespace,
42 const std::string& user_agent_override) override;
43 content::WebContents* ReplaceRestoredTab(
44 const std::vector<sessions::SerializedNavigationEntry>& navigations,
45 int selected_navigation,
46 bool from_last_session,
47 const std::string& extension_app_id,
48 content::SessionStorageNamespace* session_storage_namespace,
49 const std::string& user_agent_override) override;
50 void CloseTab() override;
52 private:
53 Browser* browser_;
55 DISALLOW_COPY_AND_ASSIGN(BrowserTabRestoreServiceDelegate);
58 #endif // CHROME_BROWSER_UI_BROWSER_TAB_RESTORE_SERVICE_DELEGATE_H_