OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 } else if (extension) { | 635 } else if (extension) { |
636 installer->set_install_source(extension->location()); | 636 installer->set_install_source(extension->location()); |
637 } | 637 } |
638 // If the extension was installed from or has migrated to the webstore, or | 638 // If the extension was installed from or has migrated to the webstore, or |
639 // its auto-update URL is from the webstore, treat it as a webstore install. | 639 // its auto-update URL is from the webstore, treat it as a webstore install. |
640 // Note that we ignore some older extensions with blank auto-update URLs | 640 // Note that we ignore some older extensions with blank auto-update URLs |
641 // because we are mostly concerned with restrictions on NaCl extensions, | 641 // because we are mostly concerned with restrictions on NaCl extensions, |
642 // which are newer. | 642 // which are newer. |
643 int creation_flags = Extension::NO_FLAGS; | 643 int creation_flags = Extension::NO_FLAGS; |
644 if ((extension && extension->from_webstore()) || | 644 if ((extension && extension->from_webstore()) || |
645 (extension && extension->UpdatesFromGallery()) || | 645 (extension && extensions::ManifestURL::UpdatesFromGallery(extension)) || |
646 (!extension && extension_urls::IsWebstoreUpdateUrl( | 646 (!extension && extension_urls::IsWebstoreUpdateUrl( |
647 pending_extension_info->update_url()))) { | 647 pending_extension_info->update_url()))) { |
648 creation_flags |= Extension::FROM_WEBSTORE; | 648 creation_flags |= Extension::FROM_WEBSTORE; |
649 } | 649 } |
650 | 650 |
651 // Bookmark apps being updated is kind of a contradiction, but that's because | 651 // Bookmark apps being updated is kind of a contradiction, but that's because |
652 // we mark the default apps as bookmark apps, and they're hosted in the web | 652 // we mark the default apps as bookmark apps, and they're hosted in the web |
653 // store, thus they can get updated. See http://crbug.com/101605 for more | 653 // store, thus they can get updated. See http://crbug.com/101605 for more |
654 // details. | 654 // details. |
655 if (extension && extension->from_bookmark()) | 655 if (extension && extension->from_bookmark()) |
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 } | 2884 } |
2885 | 2885 |
2886 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { | 2886 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { |
2887 update_observers_.AddObserver(observer); | 2887 update_observers_.AddObserver(observer); |
2888 } | 2888 } |
2889 | 2889 |
2890 void ExtensionService::RemoveUpdateObserver( | 2890 void ExtensionService::RemoveUpdateObserver( |
2891 extensions::UpdateObserver* observer) { | 2891 extensions::UpdateObserver* observer) { |
2892 update_observers_.RemoveObserver(observer); | 2892 update_observers_.RemoveObserver(observer); |
2893 } | 2893 } |
OLD | NEW |