OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #ifndef COMPONENTS_SESSIONS_CONTENT_EXTENDED_INFO_HANDLER_H_ |
| 6 #define COMPONENTS_SESSIONS_CONTENT_EXTENDED_INFO_HANDLER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/sessions/core/sessions_export.h" |
| 11 |
| 12 namespace content { |
| 13 class NavigationEntry; |
| 14 } |
| 15 |
| 16 namespace sessions { |
| 17 |
| 18 // This interface is used to store and retrieve arbitrary key/value pairs for |
| 19 // a NavigationEntry that are not a core part of NavigationEntry. |
| 20 // WARNING: implementations must deal with versioning. In particular |
| 21 // RestoreExtendedInfo() may be called with data from a previous version of |
| 22 // Chrome. |
| 23 class SESSIONS_EXPORT ExtendedInfoHandler { |
| 24 public: |
| 25 ExtendedInfoHandler() {} |
| 26 virtual ~ExtendedInfoHandler() {} |
| 27 |
| 28 // Returns the data to write to disk for the specified NavigationEntry. |
| 29 virtual std::string GetExtendedInfo( |
| 30 const content::NavigationEntry& entry) const = 0; |
| 31 |
| 32 // Restores |info| which was obtained from a previous call to |
| 33 // GetExtendedInfo() to a NavigationEntry. |
| 34 virtual void RestoreExtendedInfo(const std::string& info, |
| 35 content::NavigationEntry* entry) = 0; |
| 36 }; |
| 37 |
| 38 } // namespace sessions |
| 39 |
| 40 #endif // COMPONENTS_SESSIONS_CONTENT_EXTENDED_INFO_HANDLER_H_ |
OLD | NEW |