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

Side by Side Diff: chrome/browser/ui/app_list/search/common/json_response_fetcher.h

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 2013 The Chromium Authors. All rights reserved. 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 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_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 21 matching lines...) Expand all
32 // TODO(rkc): Add the ability to give control of handling http failures to 32 // TODO(rkc): Add the ability to give control of handling http failures to
33 // the consumers of this class. 33 // the consumers of this class.
34 class JSONResponseFetcher : public net::URLFetcherDelegate { 34 class JSONResponseFetcher : public net::URLFetcherDelegate {
35 public: 35 public:
36 // Callback to pass back the parsed json dictionary returned from the server. 36 // Callback to pass back the parsed json dictionary returned from the server.
37 // Invoked with NULL if there is an error. 37 // Invoked with NULL if there is an error.
38 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> Callback; 38 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> Callback;
39 39
40 JSONResponseFetcher(const Callback& callback, 40 JSONResponseFetcher(const Callback& callback,
41 net::URLRequestContextGetter* context_getter); 41 net::URLRequestContextGetter* context_getter);
42 virtual ~JSONResponseFetcher(); 42 ~JSONResponseFetcher() override;
43 43
44 // Starts to fetch results for the given |query_url|. 44 // Starts to fetch results for the given |query_url|.
45 void Start(const GURL& query_url); 45 void Start(const GURL& query_url);
46 void Stop(); 46 void Stop();
47 47
48 private: 48 private:
49 // Callbacks for SafeJsonParser. 49 // Callbacks for SafeJsonParser.
50 void OnJsonParseSuccess(scoped_ptr<base::Value> parsed_json); 50 void OnJsonParseSuccess(scoped_ptr<base::Value> parsed_json);
51 void OnJsonParseError(const std::string& error); 51 void OnJsonParseError(const std::string& error);
52 52
53 // net::URLFetcherDelegate overrides: 53 // net::URLFetcherDelegate overrides:
54 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; 54 void OnURLFetchComplete(const net::URLFetcher* source) override;
55 55
56 Callback callback_; 56 Callback callback_;
57 net::URLRequestContextGetter* context_getter_; 57 net::URLRequestContextGetter* context_getter_;
58 58
59 scoped_ptr<net::URLFetcher> fetcher_; 59 scoped_ptr<net::URLFetcher> fetcher_;
60 base::WeakPtrFactory<JSONResponseFetcher> weak_factory_; 60 base::WeakPtrFactory<JSONResponseFetcher> weak_factory_;
61 61
62 DISALLOW_COPY_AND_ASSIGN(JSONResponseFetcher); 62 DISALLOW_COPY_AND_ASSIGN(JSONResponseFetcher);
63 }; 63 };
64 64
65 } // namespace app_list 65 } // namespace app_list
66 66
67 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_ 67 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_JSON_RESPONSE_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698