Chromium Code Reviews| 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 #include "ui/gfx/geometry/rect.h" | |
|
sky
2017/05/12 02:42:06
forward declare rect.
chrisha
2017/06/28 18:30:42
Done.
| |
| 13 | 15 |
| 14 namespace sessions { | 16 namespace sessions { |
| 15 | 17 |
| 16 class LiveTab; | 18 class LiveTab; |
| 17 class SerializedNavigationEntry; | 19 class SerializedNavigationEntry; |
| 18 class PlatformSpecificTabData; | 20 class PlatformSpecificTabData; |
| 19 | 21 |
| 20 // An interface representing the context in which LiveTab instances exist in the | 22 // An interface representing the context in which LiveTab instances exist in the |
| 21 // embedder. As a concrete example, desktop Chrome has an implementation that | 23 // embedder. As a concrete example, desktop Chrome has an implementation that |
| 22 // is backed by an instance of the Browser class. | 24 // is backed by an instance of the Browser class. |
| 23 class SESSIONS_EXPORT LiveTabContext { | 25 class SESSIONS_EXPORT LiveTabContext { |
| 24 public: | 26 public: |
| 25 // TODO(blundell): Rename. | 27 // TODO(blundell): Rename. |
| 26 virtual void ShowBrowserWindow() = 0; | 28 virtual void ShowBrowserWindow() = 0; |
| 27 virtual const SessionID& GetSessionID() const = 0; | 29 virtual const SessionID& GetSessionID() const = 0; |
| 28 virtual int GetTabCount() const = 0; | 30 virtual int GetTabCount() const = 0; |
| 29 virtual int GetSelectedIndex() const = 0; | 31 virtual int GetSelectedIndex() const = 0; |
| 30 virtual std::string GetAppName() const = 0; | 32 virtual std::string GetAppName() const = 0; |
| 31 virtual LiveTab* GetLiveTabAt(int index) const = 0; | 33 virtual LiveTab* GetLiveTabAt(int index) const = 0; |
| 32 virtual LiveTab* GetActiveLiveTab() const = 0; | 34 virtual LiveTab* GetActiveLiveTab() const = 0; |
| 33 virtual bool IsTabPinned(int index) const = 0; | 35 virtual bool IsTabPinned(int index) const = 0; |
| 36 virtual const gfx::Rect GetBounds() const = 0; | |
| 37 virtual ui::WindowShowState GetShowState() const = 0; | |
| 38 virtual std::string GetWorkspace() const = 0; | |
| 34 | 39 |
| 35 // Note: |tab_platform_data| may be null (e.g., if |from_last_session| is | 40 // 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 | 41 // true, as this data is not persisted, or if the platform does not provide |
| 37 // platform-specific data). | 42 // platform-specific data). |
| 38 virtual LiveTab* AddRestoredTab( | 43 virtual LiveTab* AddRestoredTab( |
| 39 const std::vector<SerializedNavigationEntry>& navigations, | 44 const std::vector<SerializedNavigationEntry>& navigations, |
| 40 int tab_index, | 45 int tab_index, |
| 41 int selected_navigation, | 46 int selected_navigation, |
| 42 const std::string& extension_app_id, | 47 const std::string& extension_app_id, |
| 43 bool select, | 48 bool select, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 58 const std::string& user_agent_override) = 0; | 63 const std::string& user_agent_override) = 0; |
| 59 virtual void CloseTab() = 0; | 64 virtual void CloseTab() = 0; |
| 60 | 65 |
| 61 protected: | 66 protected: |
| 62 virtual ~LiveTabContext() {} | 67 virtual ~LiveTabContext() {} |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 } // namespace sessions | 70 } // namespace sessions |
| 66 | 71 |
| 67 #endif // COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ | 72 #endif // COMPONENTS_SESSIONS_CORE_LIVE_TAB_CONTEXT_H_ |
| OLD | NEW |