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

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

Issue 10829268: chromeos: Sync animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for sky's comments in #3 Created 8 years, 4 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/pending_extension_manager.h" 5 #include "chrome/browser/extensions/pending_extension_manager.h"
6 6
7 #include <algorithm>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/stl_util.h" 10 #include "base/stl_util.h"
9 #include "base/version.h" 11 #include "base/version.h"
10 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/extensions/pending_extension_info.h" 13 #include "chrome/browser/extensions/pending_extension_info.h"
12 #include "chrome/common/extensions/extension.h" 14 #include "chrome/common/extensions/extension.h"
13 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
14 16
15 #include <algorithm>
16
17 using content::BrowserThread; 17 using content::BrowserThread;
18 18
19 namespace { 19 namespace {
20 20
21 // Install predicate used by AddFromExternalUpdateUrl(). 21 // Install predicate used by AddFromExternalUpdateUrl().
22 bool AlwaysInstall(const extensions::Extension& extension) { 22 bool AlwaysInstall(const extensions::Extension& extension) {
23 return true; 23 return true;
24 } 24 }
25 25
26 } // namespace 26 } // namespace
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 for (iter = pending_extension_list_.begin(); 66 for (iter = pending_extension_list_.begin();
67 iter != pending_extension_list_.end(); 67 iter != pending_extension_list_.end();
68 ++iter) { 68 ++iter) {
69 if (id == iter->id()) 69 if (id == iter->id())
70 return true; 70 return true;
71 } 71 }
72 72
73 return false; 73 return false;
74 } 74 }
75 75
76 bool PendingExtensionManager::HasPendingExtensionFromSync() const {
77 PendingExtensionList::const_iterator iter;
78 for (iter = pending_extension_list_.begin();
79 iter != pending_extension_list_.end();
80 ++iter) {
81 if (iter->is_from_sync())
82 return true;
83 }
84
85 return false;
86 }
87
76 bool PendingExtensionManager::AddFromSync( 88 bool PendingExtensionManager::AddFromSync(
77 const std::string& id, 89 const std::string& id,
78 const GURL& update_url, 90 const GURL& update_url,
79 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install, 91 PendingExtensionInfo::ShouldAllowInstallPredicate should_allow_install,
80 bool install_silently) { 92 bool install_silently) {
81 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 93 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
82 94
83 if (service_.GetInstalledExtension(id)) { 95 if (service_.GetInstalledExtension(id)) {
84 LOG(ERROR) << "Trying to add pending extension " << id 96 LOG(ERROR) << "Trying to add pending extension " << id
85 << " which already exists"; 97 << " which already exists";
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 250
239 return true; 251 return true;
240 } 252 }
241 253
242 void PendingExtensionManager::AddForTesting( 254 void PendingExtensionManager::AddForTesting(
243 const PendingExtensionInfo& pending_extension_info) { 255 const PendingExtensionInfo& pending_extension_info) {
244 pending_extension_list_.push_back(pending_extension_info); 256 pending_extension_list_.push_back(pending_extension_info);
245 } 257 }
246 258
247 } // namespace extensions 259 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698