OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 | 1493 |
1494 // Broadcast unloaded and loaded events to update browser state. Only bother | 1494 // Broadcast unloaded and loaded events to update browser state. Only bother |
1495 // if the value changed and the extension is actually enabled, since there is | 1495 // if the value changed and the extension is actually enabled, since there is |
1496 // no UI otherwise. | 1496 // no UI otherwise. |
1497 bool old_enabled = extension_prefs_->IsIncognitoEnabled(extension_id); | 1497 bool old_enabled = extension_prefs_->IsIncognitoEnabled(extension_id); |
1498 if (enabled == old_enabled) | 1498 if (enabled == old_enabled) |
1499 return; | 1499 return; |
1500 | 1500 |
1501 extension_prefs_->SetIsIncognitoEnabled(extension_id, enabled); | 1501 extension_prefs_->SetIsIncognitoEnabled(extension_id, enabled); |
1502 | 1502 |
1503 bool extension_is_enabled = extensions_.Contains(extension->id()); | 1503 bool extension_is_enabled = extensions_.Contains(extension_id); |
1504 | 1504 |
1505 // When we reload the extension the ID may be invalidated if we've passed it | 1505 // When we reload the extension the ID may be invalidated if we've passed it |
1506 // by const ref everywhere. Make a copy to be safe. | 1506 // by const ref everywhere. Make a copy to be safe. |
1507 std::string id = extension_id; | 1507 std::string id = extension_id; |
1508 if (extension_is_enabled) | 1508 if (extension_is_enabled) |
1509 ReloadExtension(extension->id()); | 1509 ReloadExtension(id); |
1510 | 1510 |
1511 // Reloading the extension invalidates the |extension| pointer. | 1511 // Reloading the extension invalidates the |extension| pointer. |
1512 extension = GetInstalledExtension(id); | 1512 extension = GetInstalledExtension(id); |
1513 if (extension) | 1513 if (extension) |
1514 SyncExtensionChangeIfNeeded(*extension); | 1514 SyncExtensionChangeIfNeeded(*extension); |
1515 } | 1515 } |
1516 | 1516 |
1517 void ExtensionService::SetAppNotificationSetupDone( | 1517 void ExtensionService::SetAppNotificationSetupDone( |
1518 const std::string& extension_id, | 1518 const std::string& extension_id, |
1519 const std::string& oauth_client_id) { | 1519 const std::string& oauth_client_id) { |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2515 | 2515 |
2516 ExtensionService::NaClModuleInfoList::iterator | 2516 ExtensionService::NaClModuleInfoList::iterator |
2517 ExtensionService::FindNaClModule(const GURL& url) { | 2517 ExtensionService::FindNaClModule(const GURL& url) { |
2518 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2518 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2519 iter != nacl_module_list_.end(); ++iter) { | 2519 iter != nacl_module_list_.end(); ++iter) { |
2520 if (iter->url == url) | 2520 if (iter->url == url) |
2521 return iter; | 2521 return iter; |
2522 } | 2522 } |
2523 return nacl_module_list_.end(); | 2523 return nacl_module_list_.end(); |
2524 } | 2524 } |
OLD | NEW |