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

Side by Side Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 25366003: Moved some functions off ExtensionService into a new file extension_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows compile Created 7 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 | Annotate | Revision Log
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/extensions/extension_web_ui.h" 5 #include "chrome/browser/extensions/extension_web_ui.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h" 14 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h"
15 #include "chrome/browser/extensions/extension_service.h" 15 #include "chrome/browser/extensions/extension_service.h"
16 #include "chrome/browser/extensions/extension_tab_util.h" 16 #include "chrome/browser/extensions/extension_tab_util.h"
17 #include "chrome/browser/extensions/extension_util.h"
17 #include "chrome/browser/extensions/image_loader.h" 18 #include "chrome/browser/extensions/image_loader.h"
18 #include "chrome/browser/favicon/favicon_util.h" 19 #include "chrome/browser/favicon/favicon_util.h"
19 #include "chrome/browser/prefs/scoped_user_pref_update.h" 20 #include "chrome/browser/prefs/scoped_user_pref_update.h"
20 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
22 #include "chrome/common/extensions/extension.h" 23 #include "chrome/common/extensions/extension.h"
23 #include "chrome/common/extensions/extension_constants.h" 24 #include "chrome/common/extensions/extension_constants.h"
24 #include "chrome/common/extensions/extension_icon_set.h" 25 #include "chrome/common/extensions/extension_icon_set.h"
25 #include "chrome/common/extensions/incognito_handler.h" 26 #include "chrome/common/extensions/incognito_handler.h"
26 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 27 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // were deleted directly from the filesystem, etc. 222 // were deleted directly from the filesystem, etc.
222 LOG(WARNING) << "chrome URL override present for non-existant extension"; 223 LOG(WARNING) << "chrome URL override present for non-existant extension";
223 UnregisterChromeURLOverride(page, profile, val); 224 UnregisterChromeURLOverride(page, profile, val);
224 continue; 225 continue;
225 } 226 }
226 227
227 // We can't handle chrome-extension URLs in incognito mode unless the 228 // We can't handle chrome-extension URLs in incognito mode unless the
228 // extension uses split mode. 229 // extension uses split mode.
229 bool incognito_override_allowed = 230 bool incognito_override_allowed =
230 extensions::IncognitoInfo::IsSplitMode(extension) && 231 extensions::IncognitoInfo::IsSplitMode(extension) &&
231 service->IsIncognitoEnabled(extension->id()); 232 extension_util::IsIncognitoEnabled(extension->id(), service);
232 if (profile->IsOffTheRecord() && !incognito_override_allowed) { 233 if (profile->IsOffTheRecord() && !incognito_override_allowed) {
233 ++i; 234 ++i;
234 continue; 235 continue;
235 } 236 }
236 237
237 *url = extension_url; 238 *url = extension_url;
238 return true; 239 return true;
239 } 240 }
240 return false; 241 return false;
241 } 242 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, 418 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE,
418 gfx::Size(pixel_size, pixel_size), 419 gfx::Size(pixel_size, pixel_size),
419 scale_factors[i])); 420 scale_factors[i]));
420 } 421 }
421 422
422 // LoadImagesAsync actually can run callback synchronously. We want to force 423 // LoadImagesAsync actually can run callback synchronously. We want to force
423 // async. 424 // async.
424 extensions::ImageLoader::Get(profile)->LoadImagesAsync( 425 extensions::ImageLoader::Get(profile)->LoadImagesAsync(
425 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); 426 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback));
426 } 427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698