Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: components/ntp_snippets/remote/json_request.h

Issue 2750393002: [NTP Snippets] Don't attempt to fetch remote suggestions without API key (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 26 matching lines...) Expand all
37 enum class FetchResult { 37 enum class FetchResult {
38 SUCCESS = 0, 38 SUCCESS = 0,
39 // DEPRECATED_EMPTY_HOSTS = 1, 39 // DEPRECATED_EMPTY_HOSTS = 1,
40 URL_REQUEST_STATUS_ERROR = 2, 40 URL_REQUEST_STATUS_ERROR = 2,
41 HTTP_ERROR = 3, 41 HTTP_ERROR = 3,
42 JSON_PARSE_ERROR = 4, 42 JSON_PARSE_ERROR = 4,
43 INVALID_SNIPPET_CONTENT_ERROR = 5, 43 INVALID_SNIPPET_CONTENT_ERROR = 5,
44 OAUTH_TOKEN_ERROR = 6, 44 OAUTH_TOKEN_ERROR = 6,
45 // DEPRECATED_INTERACTIVE_QUOTA_ERROR = 7, 45 // DEPRECATED_INTERACTIVE_QUOTA_ERROR = 7,
46 // DEPRECATED_NON_INTERACTIVE_QUOTA_ERROR = 8, 46 // DEPRECATED_NON_INTERACTIVE_QUOTA_ERROR = 8,
47 RESULT_MAX = 9 47 MISSING_API_KEY = 9,
48 RESULT_MAX = 10
48 }; 49 };
49 50
50 enum FetchAPI { 51 enum FetchAPI {
51 CHROME_READER_API, 52 CHROME_READER_API,
52 CHROME_CONTENT_SUGGESTIONS_API, 53 CHROME_CONTENT_SUGGESTIONS_API,
53 }; 54 };
54 55
55 // A single request to query remote suggestions. On success, the suggestions are 56 // A single request to query remote suggestions. On success, the suggestions are
56 // returned in parsed JSON form (base::Value). 57 // returned in parsed JSON form (base::Value).
57 class JsonRequest : public net::URLFetcherDelegate { 58 class JsonRequest : public net::URLFetcherDelegate {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 base::WeakPtrFactory<JsonRequest> weak_ptr_factory_; 178 base::WeakPtrFactory<JsonRequest> weak_ptr_factory_;
178 179
179 DISALLOW_COPY_AND_ASSIGN(JsonRequest); 180 DISALLOW_COPY_AND_ASSIGN(JsonRequest);
180 }; 181 };
181 182
182 } // namespace internal 183 } // namespace internal
183 184
184 } // namespace ntp_snippets 185 } // namespace ntp_snippets
185 186
186 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_ 187 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_JSON_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698