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

Side by Side Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h

Issue 917333004: Answers in Suggest icon downloading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit changes Created 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_result_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_BITMAP_FETCHER_BITMAP_FETCHER_SERVICE_H_ 4 #ifndef CHROME_BROWSER_BITMAP_FETCHER_BITMAP_FETCHER_SERVICE_H_
5 #define CHROME_BROWSER_BITMAP_FETCHER_BITMAP_FETCHER_SERVICE_H_ 5 #define CHROME_BROWSER_BITMAP_FETCHER_BITMAP_FETCHER_SERVICE_H_
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/containers/mru_cache.h" 8 #include "base/containers/mru_cache.h"
9 #include "base/containers/scoped_ptr_hash_map.h" 9 #include "base/containers/scoped_ptr_hash_map.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 19 matching lines...) Expand all
30 public: 30 public:
31 typedef int RequestId; 31 typedef int RequestId;
32 static const RequestId REQUEST_ID_INVALID = 0; 32 static const RequestId REQUEST_ID_INVALID = 0;
33 33
34 class Observer { 34 class Observer {
35 public: 35 public:
36 virtual ~Observer() {} 36 virtual ~Observer() {}
37 37
38 // Called whenever the image changes. Called with an empty image if the 38 // Called whenever the image changes. Called with an empty image if the
39 // fetch failed or the request ended for any reason. 39 // fetch failed or the request ended for any reason.
40 // TODO(dschuyler) The comment differs from what the code does, follow-up.
40 virtual void OnImageChanged(RequestId request_id, 41 virtual void OnImageChanged(RequestId request_id,
41 const SkBitmap& answers_image) = 0; 42 const SkBitmap& answers_image) = 0;
42 }; 43 };
43 44
44 explicit BitmapFetcherService(content::BrowserContext* context); 45 explicit BitmapFetcherService(content::BrowserContext* context);
45 ~BitmapFetcherService() override; 46 ~BitmapFetcherService() override;
46 47
47 // Cancels a request, if it is still in-flight. 48 // Cancels a request, if it is still in-flight.
48 void CancelRequest(RequestId requestId); 49 void CancelRequest(RequestId requestId);
49 50
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // Current request ID to be used. 102 // Current request ID to be used.
102 int current_request_id_; 103 int current_request_id_;
103 104
104 // Browser context this service is active for. 105 // Browser context this service is active for.
105 content::BrowserContext* context_; 106 content::BrowserContext* context_;
106 107
107 DISALLOW_COPY_AND_ASSIGN(BitmapFetcherService); 108 DISALLOW_COPY_AND_ASSIGN(BitmapFetcherService);
108 }; 109 };
109 110
110 #endif // CHROME_BROWSER_BITMAP_FETCHER_BITMAP_FETCHER_SERVICE_H_ 111 #endif // CHROME_BROWSER_BITMAP_FETCHER_BITMAP_FETCHER_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_result_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698