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/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } | 498 } |
499 } | 499 } |
500 } | 500 } |
501 | 501 |
502 void ExtensionSorting::SyncIfNeeded(const std::string& extension_id) { | 502 void ExtensionSorting::SyncIfNeeded(const std::string& extension_id) { |
503 if (extension_service_) { | 503 if (extension_service_) { |
504 const Extension* ext = | 504 const Extension* ext = |
505 extension_service_->GetInstalledExtension(extension_id); | 505 extension_service_->GetInstalledExtension(extension_id); |
506 | 506 |
507 if (ext) { | 507 if (ext) { |
508 CHECK(ext->is_app()); | 508 // It is possible for old extension to have ordinal values, but they |
| 509 // shouldn't so we clear them. |
| 510 if (!ext->is_app()) |
| 511 ClearOrdinals(extension_id); |
| 512 |
509 extension_service_->SyncExtensionChangeIfNeeded(*ext); | 513 extension_service_->SyncExtensionChangeIfNeeded(*ext); |
510 } | 514 } |
511 } | 515 } |
512 } | 516 } |
OLD | NEW |