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 CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include "chrome/browser/history/history_types.h" | 8 #include "chrome/browser/history/history_types.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_keyed_service.h" | 10 #include "chrome/browser/profiles/profile_keyed_service.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // supports a similar API. | 24 // supports a similar API. |
25 class WebHistoryService : public ProfileKeyedService { | 25 class WebHistoryService : public ProfileKeyedService { |
26 public: | 26 public: |
27 // Handles all the work of making an API request. This class encapsulates | 27 // Handles all the work of making an API request. This class encapsulates |
28 // the entire state of the request. When an instance is destroyed, all | 28 // the entire state of the request. When an instance is destroyed, all |
29 // aspects of the request are cancelled. | 29 // aspects of the request are cancelled. |
30 class Request { | 30 class Request { |
31 public: | 31 public: |
32 virtual ~Request(); | 32 virtual ~Request(); |
33 | 33 |
| 34 // Returns true if the request is "pending" (i.e., it has been started, but |
| 35 // is not yet been complete). |
| 36 virtual bool is_pending() = 0; |
| 37 |
34 protected: | 38 protected: |
35 Request(); | 39 Request(); |
36 }; | 40 }; |
37 | 41 |
38 // Callback with the result of a call to QueryHistory(). Currently, the | 42 // Callback with the result of a call to QueryHistory(). Currently, the |
39 // DictionaryValue is just the parsed JSON response from the server. | 43 // DictionaryValue is just the parsed JSON response from the server. |
40 // TODO(dubroy): Extract the DictionaryValue into a structured results object. | 44 // TODO(dubroy): Extract the DictionaryValue into a structured results object. |
41 typedef base::Callback<void(Request*, const base::DictionaryValue*)> | 45 typedef base::Callback<void(Request*, const base::DictionaryValue*)> |
42 QueryWebHistoryCallback; | 46 QueryWebHistoryCallback; |
43 | 47 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // a mutation operation (e.g., deleting history). This is used to ensure that | 93 // a mutation operation (e.g., deleting history). This is used to ensure that |
90 // subsequent reads see a version of the data that includes the mutation. | 94 // subsequent reads see a version of the data that includes the mutation. |
91 std::string server_version_info_; | 95 std::string server_version_info_; |
92 | 96 |
93 DISALLOW_COPY_AND_ASSIGN(WebHistoryService); | 97 DISALLOW_COPY_AND_ASSIGN(WebHistoryService); |
94 }; | 98 }; |
95 | 99 |
96 } // namespace history | 100 } // namespace history |
97 | 101 |
98 #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ | 102 #endif // CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_H_ |
OLD | NEW |