OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ |
6 #define COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ | 6 #define COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "components/sessions/core/session_id.h" | 11 #include "components/sessions/core/session_id.h" |
12 #include "components/sessions/core/sessions_export.h" | 12 #include "components/sessions/core/sessions_export.h" |
| 13 #include "ui/base/ui_base_types.h" |
| 14 |
| 15 namespace gfx { |
| 16 class Rect; |
| 17 } |
13 | 18 |
14 namespace sessions { | 19 namespace sessions { |
15 | 20 |
16 class LiveTab; | 21 class LiveTab; |
17 class SerializedNavigationEntry; | 22 class SerializedNavigationEntry; |
18 class PlatformSpecificTabData; | 23 class PlatformSpecificTabData; |
19 | 24 |
20 // An interface representing the context in which LiveTab instances exist in the | 25 // An interface representing the context in which LiveTab instances exist in the |
21 // embedder. As a concrete example, desktop Chrome has an implementation that | 26 // embedder. As a concrete example, desktop Chrome has an implementation that |
22 // is backed by an instance of the Browser class. | 27 // is backed by an instance of the Browser class. |
23 class SESSIONS_EXPORT LiveTabContext { | 28 class SESSIONS_EXPORT LiveTabContext { |
24 public: | 29 public: |
25 // TODO(blundell): Rename. | 30 // TODO(blundell): Rename. |
26 virtual void ShowBrowserWindow() = 0; | 31 virtual void ShowBrowserWindow() = 0; |
27 virtual const SessionID& GetSessionID() const = 0; | 32 virtual const SessionID& GetSessionID() const = 0; |
28 virtual int GetTabCount() const = 0; | 33 virtual int GetTabCount() const = 0; |
29 virtual int GetSelectedIndex() const = 0; | 34 virtual int GetSelectedIndex() const = 0; |
30 virtual std::string GetAppName() const = 0; | 35 virtual std::string GetAppName() const = 0; |
31 virtual LiveTab* GetLiveTabAt(int index) const = 0; | 36 virtual LiveTab* GetLiveTabAt(int index) const = 0; |
32 virtual LiveTab* GetActiveLiveTab() const = 0; | 37 virtual LiveTab* GetActiveLiveTab() const = 0; |
33 virtual bool IsTabPinned(int index) const = 0; | 38 virtual bool IsTabPinned(int index) const = 0; |
| 39 virtual const gfx::Rect GetRestoredBounds() const = 0; |
| 40 virtual ui::WindowShowState GetRestoredState() const = 0; |
| 41 virtual std::string GetWorkspace() const = 0; |
34 | 42 |
35 // Note: |tab_platform_data| may be null (e.g., if |from_last_session| is | 43 // Note: |tab_platform_data| may be null (e.g., if |from_last_session| is |
36 // true, as this data is not persisted, or if the platform does not provide | 44 // true, as this data is not persisted, or if the platform does not provide |
37 // platform-specific data). | 45 // platform-specific data). |
38 virtual LiveTab* AddRestoredTab( | 46 virtual LiveTab* AddRestoredTab( |
39 const std::vector<SerializedNavigationEntry>& navigations, | 47 const std::vector<SerializedNavigationEntry>& navigations, |
40 int tab_index, | 48 int tab_index, |
41 int selected_navigation, | 49 int selected_navigation, |
42 const std::string& extension_app_id, | 50 const std::string& extension_app_id, |
43 bool select, | 51 bool select, |
(...skipping 14 matching lines...) Expand all Loading... |
58 const std::string& user_agent_override) = 0; | 66 const std::string& user_agent_override) = 0; |
59 virtual void CloseTab() = 0; | 67 virtual void CloseTab() = 0; |
60 | 68 |
61 protected: | 69 protected: |
62 virtual ~LiveTabContext() {} | 70 virtual ~LiveTabContext() {} |
63 }; | 71 }; |
64 | 72 |
65 } // namespace sessions | 73 } // namespace sessions |
66 | 74 |
67 #endif // COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ | 75 #endif // COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ |
OLD | NEW |