| 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/extension_sorting.h" | 5 #include "chrome/browser/extensions/extension_sorting.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_scoped_prefs.h" | 7 #include "chrome/browser/extensions/extension_scoped_prefs.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 it != page_map->second.end(); ++it) { | 489 it != page_map->second.end(); ++it) { |
| 490 if (it->second == extension_id) { | 490 if (it->second == extension_id) { |
| 491 page_map->second.erase(it); | 491 page_map->second.erase(it); |
| 492 break; | 492 break; |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 | 496 |
| 497 void ExtensionSorting::SyncIfNeeded(const std::string& extension_id) { | 497 void ExtensionSorting::SyncIfNeeded(const std::string& extension_id) { |
| 498 if (extension_service_) { | 498 if (extension_service_) { |
| 499 const Extension* ext = | 499 const extensions::Extension* ext = |
| 500 extension_service_->GetInstalledExtension(extension_id); | 500 extension_service_->GetInstalledExtension(extension_id); |
| 501 | 501 |
| 502 if (ext) { | 502 if (ext) { |
| 503 // It is possible for old extension to have ordinal values, but they | 503 // It is possible for old extension to have ordinal values, but they |
| 504 // shouldn't so we clear them. | 504 // shouldn't so we clear them. |
| 505 if (!ext->is_app()) | 505 if (!ext->is_app()) |
| 506 ClearOrdinals(extension_id); | 506 ClearOrdinals(extension_id); |
| 507 | 507 |
| 508 extension_service_->SyncExtensionChangeIfNeeded(*ext); | 508 extension_service_->SyncExtensionChangeIfNeeded(*ext); |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 } | 511 } |
| OLD | NEW |