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

Side by Side Diff: chrome/browser/extensions/webstore_data_fetcher.h

Issue 12212076: Move web store data fetching and parsing out of WebstoreStandaloneInstaller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/webstore_data_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 CHROME_BROWSER_EXTENSIONS_WEBSTORE_DATA_FETCHER_H_
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_DATA_FETCHER_H_
7
8 #include <string>
9
10 #include "base/memory/weak_ptr.h"
11 #include "googleurl/src/gurl.h"
12 #include "net/url_request/url_fetcher_delegate.h"
13
14 namespace base {
15 class DictionaryValue;
16 }
17
18 namespace net {
19 class URLFetcher;
20 class URLRequestContextGetter;
21 }
22
23 namespace extensions {
24
25 class WebstoreDataFetcherDelegate;
26
27 // WebstoreDataFetcher fetches web store data and parses it into a
28 // DictionaryValue.
29 class WebstoreDataFetcher : public base::SupportsWeakPtr<WebstoreDataFetcher>,
30 public net::URLFetcherDelegate {
31 public:
32 WebstoreDataFetcher(WebstoreDataFetcherDelegate* delegate,
33 net::URLRequestContextGetter* request_context,
34 const GURL& referrer_url,
35 const std::string webstore_item_id);
36 virtual ~WebstoreDataFetcher();
37
38 void Start();
39
40 private:
41 class SafeWebstoreResponseParser;
42
43 // Client callbacks for SafeWebstoreResponseParser when parsing is complete.
44 void OnWebstoreResponseParseSuccess(base::DictionaryValue* webstore_data);
45 void OnWebstoreResponseParseFailure(const std::string& error);
46
47 // net::URLFetcherDelegate overrides:
48 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
49
50 WebstoreDataFetcherDelegate* delegate_;
51 net::URLRequestContextGetter* request_context_;
52 GURL referrer_url_;
53 std::string id_;
54
55 // For fetching webstore JSON data.
56 scoped_ptr<net::URLFetcher> webstore_data_url_fetcher_;
57
58 DISALLOW_COPY_AND_ASSIGN(WebstoreDataFetcher);
59 };
60
61 } // namespace extensions
62
63 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_DATA_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/webstore_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698