[email protected] | a636d8e5 | 2012-02-28 15:40:41 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
blundell | bde024d | 2015-09-30 13:47:07 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_UI_BROWSER_LIVE_TAB_CONTEXT_H_ |
6 | #define CHROME_BROWSER_UI_BROWSER_LIVE_TAB_CONTEXT_H_ | ||||
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 7 | |
8 | #include <string> | ||||
9 | #include <vector> | ||||
10 | |||||
11 | #include "base/compiler_specific.h" | ||||
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 12 | #include "base/macros.h" |
blundell | bde024d | 2015-09-30 13:47:07 | [diff] [blame] | 13 | #include "components/sessions/core/live_tab_context.h" |
Connie Wan | 866179b | 2019-12-18 21:39:33 | [diff] [blame] | 14 | #include "components/tab_groups/tab_group_id.h" |
15 | #include "components/tab_groups/tab_group_visual_data.h" | ||||
chrisha | b1ba090f | 2017-08-18 22:00:50 | [diff] [blame] | 16 | #include "ui/base/ui_base_types.h" |
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 17 | |
18 | class Browser; | ||||
blundell | 7bf49a3d | 2015-09-14 18:38:11 | [diff] [blame] | 19 | class Profile; |
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 20 | |
blundell | 80c5b2a0 | 2015-09-17 18:22:12 | [diff] [blame] | 21 | namespace content { |
22 | class WebContents; | ||||
23 | } | ||||
24 | |||||
chrisha | b1ba090f | 2017-08-18 22:00:50 | [diff] [blame] | 25 | namespace gfx { |
26 | class Rect; | ||||
27 | } | ||||
28 | |||||
blundell | bde024d | 2015-09-30 13:47:07 | [diff] [blame] | 29 | // Implementation of LiveTabContext which uses an instance of |
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 30 | // Browser in order to fulfil its duties. |
blundell | bde024d | 2015-09-30 13:47:07 | [diff] [blame] | 31 | class BrowserLiveTabContext : public sessions::LiveTabContext { |
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 32 | public: |
blundell | bde024d | 2015-09-30 13:47:07 | [diff] [blame] | 33 | explicit BrowserLiveTabContext(Browser* browser) : browser_(browser) {} |
34 | ~BrowserLiveTabContext() override {} | ||||
[email protected] | fb7da413 | 2011-03-15 15:51:00 | [diff] [blame] | 35 | |
blundell | bde024d | 2015-09-30 13:47:07 | [diff] [blame] | 36 | // Overridden from LiveTabContext: |
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 37 | void ShowBrowserWindow() override; |
Mikel Astiz | e023c57 | 2018-03-28 07:56:56 | [diff] [blame] | 38 | SessionID GetSessionID() const override; |
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 39 | int GetTabCount() const override; |
40 | int GetSelectedIndex() const override; | ||||
41 | std::string GetAppName() const override; | ||||
blundell | 80c5b2a0 | 2015-09-17 18:22:12 | [diff] [blame] | 42 | sessions::LiveTab* GetLiveTabAt(int index) const override; |
43 | sessions::LiveTab* GetActiveLiveTab() const override; | ||||
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 44 | bool IsTabPinned(int index) const override; |
Connie Wan | 866179b | 2019-12-18 21:39:33 | [diff] [blame] | 45 | base::Optional<tab_groups::TabGroupId> GetTabGroupForTab( |
46 | int index) const override; | ||||
Connie Wan | dfd8f83 | 2020-01-06 20:22:30 | [diff] [blame] | 47 | const tab_groups::TabGroupVisualData* GetVisualDataForGroup( |
48 | const tab_groups::TabGroupId& group) const override; | ||||
Connie Wan | 866179b | 2019-12-18 21:39:33 | [diff] [blame] | 49 | void SetVisualDataForGroup( |
Connie Wan | dfd8f83 | 2020-01-06 20:22:30 | [diff] [blame] | 50 | const tab_groups::TabGroupId& group, |
51 | const tab_groups::TabGroupVisualData& visual_data) override; | ||||
chrisha | b1ba090f | 2017-08-18 22:00:50 | [diff] [blame] | 52 | const gfx::Rect GetRestoredBounds() const override; |
53 | ui::WindowShowState GetRestoredState() const override; | ||||
54 | std::string GetWorkspace() const override; | ||||
55 | |||||
blundell | 80c5b2a0 | 2015-09-17 18:22:12 | [diff] [blame] | 56 | sessions::LiveTab* AddRestoredTab( |
[email protected] | 40a7e41 | 2013-04-29 18:13:01 | [diff] [blame] | 57 | const std::vector<sessions::SerializedNavigationEntry>& navigations, |
[email protected] |