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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_icon_source.cc

Issue 2774263002: Specify AllowCaching = false for dynamically-generated contents (Closed)
Patch Set: typo 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 (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 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 5 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 ExtensionResource icon = IconsInfo::GetIconResource( 131 ExtensionResource icon = IconsInfo::GetIconResource(
132 request->extension.get(), request->size, request->match); 132 request->extension.get(), request->size, request->match);
133 133
134 if (icon.relative_path().empty()) { 134 if (icon.relative_path().empty()) {
135 LoadIconFailed(next_id); 135 LoadIconFailed(next_id);
136 } else { 136 } else {
137 LoadExtensionImage(icon, next_id); 137 LoadExtensionImage(icon, next_id);
138 } 138 }
139 } 139 }
140 140
141 bool ExtensionIconSource::AllowCaching() const {
142 // Should not be cached to reflect the latest contents that may be updated by
143 // Extensions.
144 return false;
145 }
146
141 ExtensionIconSource::~ExtensionIconSource() { 147 ExtensionIconSource::~ExtensionIconSource() {
142 } 148 }
143 149
144 const SkBitmap* ExtensionIconSource::GetDefaultAppImage() { 150 const SkBitmap* ExtensionIconSource::GetDefaultAppImage() {
145 if (!default_app_data_.get()) 151 if (!default_app_data_.get())
146 default_app_data_.reset(LoadImageByResourceId(IDR_APP_DEFAULT_ICON)); 152 default_app_data_.reset(LoadImageByResourceId(IDR_APP_DEFAULT_ICON));
147 153
148 return default_app_data_.get(); 154 return default_app_data_.get();
149 } 155 }
150 156
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 ExtensionIconSource::ExtensionIconRequest* ExtensionIconSource::GetData( 335 ExtensionIconSource::ExtensionIconRequest* ExtensionIconSource::GetData(
330 int request_id) { 336 int request_id) {
331 return request_map_[request_id].get(); 337 return request_map_[request_id].get();
332 } 338 }
333 339
334 void ExtensionIconSource::ClearData(int request_id) { 340 void ExtensionIconSource::ClearData(int request_id) {
335 request_map_.erase(request_id); 341 request_map_.erase(request_id);
336 } 342 }
337 343
338 } // namespace extensions 344 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_icon_source.h ('k') | chrome/browser/ui/webui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698