OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_sync_service.h" | 5 #include "chrome/browser/extensions/extension_sync_service.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 if (extension_sync_data.uninstalled()) { | 380 if (extension_sync_data.uninstalled()) { |
381 if (!extension_service_->UninstallExtensionHelper(extension_service_, id)) { | 381 if (!extension_service_->UninstallExtensionHelper(extension_service_, id)) { |
382 LOG(WARNING) << "Could not uninstall extension " << id | 382 LOG(WARNING) << "Could not uninstall extension " << id |
383 << " for sync"; | 383 << " for sync"; |
384 } | 384 } |
385 return true; | 385 return true; |
386 } | 386 } |
387 | 387 |
388 // Extension from sync was uninstalled by the user as external extensions. | 388 // Extension from sync was uninstalled by the user as external extensions. |
389 // Honor user choice and skip installation/enabling. | 389 // Honor user choice and skip installation/enabling. |
390 if (extension_service_->IsExternalExtensionUninstalled(id)) { | 390 if (extensions::ExtensionPrefs::Get(profile_) |
| 391 ->IsExternalExtensionUninstalled(id)) { |
391 LOG(WARNING) << "Extension with id " << id | 392 LOG(WARNING) << "Extension with id " << id |
392 << " from sync was uninstalled as external extension"; | 393 << " from sync was uninstalled as external extension"; |
393 return true; | 394 return true; |
394 } | 395 } |
395 | 396 |
396 // Set user settings. | 397 // Set user settings. |
397 // If the extension has been disabled from sync, it may not have | 398 // If the extension has been disabled from sync, it may not have |
398 // been installed yet, so we don't know if the disable reason was a | 399 // been installed yet, so we don't know if the disable reason was a |
399 // permissions increase. That will be updated once CheckPermissionsIncrease | 400 // permissions increase. That will be updated once CheckPermissionsIncrease |
400 // is called for it. | 401 // is called for it. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 app_sync_bundle_.SyncChangeIfNeeded(extension); | 456 app_sync_bundle_.SyncChangeIfNeeded(extension); |
456 else if (extension_service_->is_ready() && !flare_.is_null()) | 457 else if (extension_service_->is_ready() && !flare_.is_null()) |
457 flare_.Run(syncer::APPS); | 458 flare_.Run(syncer::APPS); |
458 } else if (extensions::sync_helper::IsSyncableExtension(&extension)) { | 459 } else if (extensions::sync_helper::IsSyncableExtension(&extension)) { |
459 if (extension_sync_bundle_.IsSyncing()) | 460 if (extension_sync_bundle_.IsSyncing()) |
460 extension_sync_bundle_.SyncChangeIfNeeded(extension); | 461 extension_sync_bundle_.SyncChangeIfNeeded(extension); |
461 else if (extension_service_->is_ready() && !flare_.is_null()) | 462 else if (extension_service_->is_ready() && !flare_.is_null()) |
462 flare_.Run(syncer::EXTENSIONS); | 463 flare_.Run(syncer::EXTENSIONS); |
463 } | 464 } |
464 } | 465 } |
OLD | NEW |