OLD | NEW |
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 | 4 |
5 #include "chrome/browser/extensions/extension_install_checker.h" | 5 #include "chrome/browser/extensions/extension_install_checker.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/blacklist.h" | 8 #include "chrome/browser/extensions/blacklist.h" |
9 #include "chrome/browser/extensions/requirements_checker.h" | 9 #include "chrome/browser/extensions/requirements_checker.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 requirement_errors_ = errors; | 108 requirement_errors_ = errors; |
109 | 109 |
110 running_checks_ &= ~CHECK_REQUIREMENTS; | 110 running_checks_ &= ~CHECK_REQUIREMENTS; |
111 MaybeInvokeCallback(); | 111 MaybeInvokeCallback(); |
112 } | 112 } |
113 | 113 |
114 void ExtensionInstallChecker::CheckBlacklistState() { | 114 void ExtensionInstallChecker::CheckBlacklistState() { |
115 DCHECK(extension_.get()); | 115 DCHECK(extension_.get()); |
116 | 116 |
117 extensions::Blacklist* blacklist = | 117 extensions::Blacklist* blacklist = Blacklist::Get(profile_); |
118 ExtensionSystem::Get(profile_)->blacklist(); | |
119 blacklist->IsBlacklisted( | 118 blacklist->IsBlacklisted( |
120 extension_->id(), | 119 extension_->id(), |
121 base::Bind(&ExtensionInstallChecker::OnBlacklistStateCheckDone, | 120 base::Bind(&ExtensionInstallChecker::OnBlacklistStateCheckDone, |
122 weak_ptr_factory_.GetWeakPtr(), | 121 weak_ptr_factory_.GetWeakPtr(), |
123 current_sequence_number_)); | 122 current_sequence_number_)); |
124 } | 123 } |
125 | 124 |
126 void ExtensionInstallChecker::OnBlacklistStateCheckDone(int sequence_number, | 125 void ExtensionInstallChecker::OnBlacklistStateCheckDone(int sequence_number, |
127 BlacklistState state) { | 126 BlacklistState state) { |
128 // Some pending results may arrive after fail fast. | 127 // Some pending results may arrive after fail fast. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 Callback callback_copy = callback_; | 165 Callback callback_copy = callback_; |
167 callback_.Reset(); | 166 callback_.Reset(); |
168 | 167 |
169 // This instance may be owned by the callback recipient and deleted here, | 168 // This instance may be owned by the callback recipient and deleted here, |
170 // so reset |callback_| first and invoke a copy of the callback. | 169 // so reset |callback_| first and invoke a copy of the callback. |
171 callback_copy.Run(failed_mask); | 170 callback_copy.Run(failed_mask); |
172 } | 171 } |
173 } | 172 } |
174 | 173 |
175 } // namespace extensions | 174 } // namespace extensions |
OLD | NEW |