OLD | NEW |
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/api/omnibox/omnibox_api.h" | 5 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 ExtensionPrefs::Get(profile_)->GetInstallTime(extension->id())); | 226 ExtensionPrefs::Get(profile_)->GetInstallTime(extension->id())); |
227 } else { | 227 } else { |
228 pending_extensions_.insert(extension); | 228 pending_extensions_.insert(extension); |
229 } | 229 } |
230 } | 230 } |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 void OmniboxAPI::OnExtensionUnloaded(content::BrowserContext* browser_context, | 234 void OmniboxAPI::OnExtensionUnloaded(content::BrowserContext* browser_context, |
235 const Extension* extension, | 235 const Extension* extension, |
236 UnloadedExtensionInfo::Reason reason) { | 236 UnloadedExtensionReason reason) { |
237 if (!OmniboxInfo::GetKeyword(extension).empty() && url_service_) { | 237 if (!OmniboxInfo::GetKeyword(extension).empty() && url_service_) { |
238 if (url_service_->loaded()) { | 238 if (url_service_->loaded()) { |
239 url_service_->RemoveExtensionControlledTURL( | 239 url_service_->RemoveExtensionControlledTURL( |
240 extension->id(), TemplateURL::OMNIBOX_API_EXTENSION); | 240 extension->id(), TemplateURL::OMNIBOX_API_EXTENSION); |
241 } else { | 241 } else { |
242 pending_extensions_.erase(extension); | 242 pending_extensions_.erase(extension); |
243 } | 243 } |
244 } | 244 } |
245 } | 245 } |
246 | 246 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 for (size_t i = 0; i < description_styles.size(); ++i) { | 378 for (size_t i = 0; i < description_styles.size(); ++i) { |
379 if (description_styles[i].offset > placeholder) | 379 if (description_styles[i].offset > placeholder) |
380 description_styles[i].offset += replacement.length() - 2; | 380 description_styles[i].offset += replacement.length() - 2; |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 match->contents.assign(description); | 384 match->contents.assign(description); |
385 } | 385 } |
386 | 386 |
387 } // namespace extensions | 387 } // namespace extensions |
OLD | NEW |