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

Side by Side Diff: chrome/browser/background/background_application_list_model.cc

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/browser_process_impl.cc » ('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 (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/background/background_application_list_model.h" 5 #include "chrome/browser/background/background_application_list_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/app/chrome_command_ids.h" 12 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/background/background_contents_service.h" 13 #include "chrome/browser/background/background_contents_service.h"
14 #include "chrome/browser/background/background_contents_service_factory.h" 14 #include "chrome/browser/background/background_contents_service_factory.h"
15 #include "chrome/browser/background/background_mode_manager.h" 15 #include "chrome/browser/background/background_mode_manager.h"
16 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/extensions/extension_prefs.h" 17 #include "chrome/browser/extensions/extension_prefs.h"
18 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/extensions/extension_system.h" 19 #include "chrome/browser/extensions/extension_system.h"
20 #include "chrome/browser/extensions/image_loader.h" 20 #include "chrome/browser/extensions/image_loader.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/common/chrome_notification_types.h" 22 #include "chrome/common/chrome_notification_types.h"
23 #include "chrome/common/extensions/api/icons/icons_handler.h" 23 #include "chrome/common/extensions/api/icons/icons_handler.h"
24 #include "chrome/common/extensions/background_info.h" 24 #include "chrome/common/extensions/background_info.h"
25 #include "chrome/common/extensions/extension.h" 25 #include "chrome/common/extensions/extension.h"
26 #include "chrome/common/extensions/extension_constants.h" 26 #include "chrome/common/extensions/extension_constants.h"
27 #include "chrome/common/extensions/extension_icon_set.h" 27 #include "chrome/common/extensions/extension_icon_set.h"
28 #include "chrome/common/extensions/extension_resource.h"
29 #include "chrome/common/extensions/permissions/permission_set.h" 28 #include "chrome/common/extensions/permissions/permission_set.h"
30 #include "content/public/browser/notification_details.h" 29 #include "content/public/browser/notification_details.h"
31 #include "content/public/browser/notification_source.h" 30 #include "content/public/browser/notification_source.h"
31 #include "extensions/common/extension_resource.h"
32 #include "ui/base/l10n/l10n_util_collator.h" 32 #include "ui/base/l10n/l10n_util_collator.h"
33 #include "ui/gfx/image/image.h" 33 #include "ui/gfx/image/image.h"
34 #include "ui/gfx/image/image_skia.h" 34 #include "ui/gfx/image/image_skia.h"
35 35
36 using extensions::APIPermission; 36 using extensions::APIPermission;
37 using extensions::Extension; 37 using extensions::Extension;
38 using extensions::ExtensionList; 38 using extensions::ExtensionList;
39 using extensions::PermissionSet; 39 using extensions::PermissionSet;
40 using extensions::UnloadedExtensionInfo; 40 using extensions::UnloadedExtensionInfo;
41 using extensions::UpdatedExtensionPermissionsInfo; 41 using extensions::UpdatedExtensionPermissionsInfo;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 void BackgroundApplicationListModel::Application::OnImageLoaded( 147 void BackgroundApplicationListModel::Application::OnImageLoaded(
148 const gfx::Image& image) { 148 const gfx::Image& image) {
149 if (image.IsEmpty()) 149 if (image.IsEmpty())
150 return; 150 return;
151 icon_.reset(image.CopyImageSkia()); 151 icon_.reset(image.CopyImageSkia());
152 model_->SendApplicationDataChangedNotifications(extension_); 152 model_->SendApplicationDataChangedNotifications(extension_);
153 } 153 }
154 154
155 void BackgroundApplicationListModel::Application::RequestIcon( 155 void BackgroundApplicationListModel::Application::RequestIcon(
156 extension_misc::ExtensionIcons size) { 156 extension_misc::ExtensionIcons size) {
157 ExtensionResource resource = extensions::IconsInfo::GetIconResource( 157 extensions::ExtensionResource resource =
158 extension_, size, ExtensionIconSet::MATCH_BIGGER); 158 extensions::IconsInfo::GetIconResource(
159 extension_, size, ExtensionIconSet::MATCH_BIGGER);
159 extensions::ImageLoader::Get(model_->profile_)->LoadImageAsync( 160 extensions::ImageLoader::Get(model_->profile_)->LoadImageAsync(
160 extension_, resource, gfx::Size(size, size), 161 extension_, resource, gfx::Size(size, size),
161 base::Bind(&Application::OnImageLoaded, AsWeakPtr())); 162 base::Bind(&Application::OnImageLoaded, AsWeakPtr()));
162 } 163 }
163 164
164 BackgroundApplicationListModel::~BackgroundApplicationListModel() { 165 BackgroundApplicationListModel::~BackgroundApplicationListModel() {
165 STLDeleteContainerPairSecondPointers(applications_.begin(), 166 STLDeleteContainerPairSecondPointers(applications_.begin(),
166 applications_.end()); 167 applications_.end());
167 } 168 }
168 169
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 (*old_cursor)->name() == (*new_cursor)->name() && 411 (*old_cursor)->name() == (*new_cursor)->name() &&
411 (*old_cursor)->id() == (*new_cursor)->id()) { 412 (*old_cursor)->id() == (*new_cursor)->id()) {
412 ++old_cursor; 413 ++old_cursor;
413 ++new_cursor; 414 ++new_cursor;
414 } 415 }
415 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { 416 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) {
416 extensions_ = extensions; 417 extensions_ = extensions;
417 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); 418 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_));
418 } 419 }
419 } 420 }
OLDNEW
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698