| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TAB_RESTORE_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ |
| 6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Note that |host_desktop_type| is opaque to the component; the only values | 66 // Note that |host_desktop_type| is opaque to the component; the only values |
| 67 // that will be passed here are those that have been passed *in* to the | 67 // that will be passed here are those that have been passed *in* to the |
| 68 // component from the embedder via TabRestoreService. | 68 // component from the embedder via TabRestoreService. |
| 69 virtual TabRestoreServiceDelegate* FindTabRestoreServiceDelegateWithID( | 69 virtual TabRestoreServiceDelegate* FindTabRestoreServiceDelegateWithID( |
| 70 SessionID::id_type desired_id, | 70 SessionID::id_type desired_id, |
| 71 int host_desktop_type) = 0; | 71 int host_desktop_type) = 0; |
| 72 | 72 |
| 73 // Returns whether a given URL should be tracked for restoring. | 73 // Returns whether a given URL should be tracked for restoring. |
| 74 virtual bool ShouldTrackURLForRestore(const GURL& url) = 0; | 74 virtual bool ShouldTrackURLForRestore(const GURL& url) = 0; |
| 75 | 75 |
| 76 // Returns the extension app ID for the given WebContents, or the empty string |
| 77 // if there is no such ID (e.g., if extensions are not supported by the |
| 78 // embedder). |
| 79 // TODO(blundell): Replace the usage of WebContents here with the cross- |
| 80 // platform interface that will abstract it. crbug.com/530174 |
| 81 virtual std::string GetExtensionAppIDForWebContents( |
| 82 content::WebContents* web_contents) = 0; |
| 83 |
| 76 // Get the sequenced worker pool for running tasks on the backend thread as | 84 // Get the sequenced worker pool for running tasks on the backend thread as |
| 77 // long as the system is not shutting down. | 85 // long as the system is not shutting down. |
| 78 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; | 86 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; |
| 79 | 87 |
| 80 // Returns the path of the directory to save state into. | 88 // Returns the path of the directory to save state into. |
| 81 virtual base::FilePath GetPathToSaveTo() = 0; | 89 virtual base::FilePath GetPathToSaveTo() = 0; |
| 82 | 90 |
| 83 // Returns the URL that corresponds to the new tab page. | 91 // Returns the URL that corresponds to the new tab page. |
| 84 virtual GURL GetNewTabURL() = 0; | 92 virtual GURL GetNewTabURL() = 0; |
| 85 | 93 |
| 86 // Returns whether there is a previous session to load. | 94 // Returns whether there is a previous session to load. |
| 87 virtual bool HasLastSession() = 0; | 95 virtual bool HasLastSession() = 0; |
| 88 | 96 |
| 89 // Fetches the contents of the last session, notifying the callback when | 97 // Fetches the contents of the last session, notifying the callback when |
| 90 // done. If the callback is supplied an empty vector of SessionWindows | 98 // done. If the callback is supplied an empty vector of SessionWindows |
| 91 // it means the session could not be restored. | 99 // it means the session could not be restored. |
| 92 virtual void GetLastSession(const GetLastSessionCallback& callback, | 100 virtual void GetLastSession(const GetLastSessionCallback& callback, |
| 93 base::CancelableTaskTracker* tracker) = 0; | 101 base::CancelableTaskTracker* tracker) = 0; |
| 94 | 102 |
| 95 // Called when a tab is restored. |url| is the URL that the tab is currently | 103 // Called when a tab is restored. |url| is the URL that the tab is currently |
| 96 // visiting. | 104 // visiting. |
| 97 virtual void OnTabRestored(const GURL& url) {} | 105 virtual void OnTabRestored(const GURL& url) {} |
| 98 }; | 106 }; |
| 99 | 107 |
| 100 } // namespace sessions | 108 } // namespace sessions |
| 101 | 109 |
| 102 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ | 110 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ |
| OLD | NEW |