Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 8529001: Fix crash in ExtensionService::SetIsIncognitoEnabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 // work in incognito mode. 1449 // work in incognito mode.
1450 const Extension* extension = GetInstalledExtension(extension_id); 1450 const Extension* extension = GetInstalledExtension(extension_id);
1451 if (extension && extension->location() == Extension::COMPONENT) 1451 if (extension && extension->location() == Extension::COMPONENT)
1452 return true; 1452 return true;
1453 1453
1454 // Check the prefs. 1454 // Check the prefs.
1455 return extension_prefs_->IsIncognitoEnabled(extension_id); 1455 return extension_prefs_->IsIncognitoEnabled(extension_id);
1456 } 1456 }
1457 1457
1458 void ExtensionService::SetIsIncognitoEnabled( 1458 void ExtensionService::SetIsIncognitoEnabled(
1459 const std::string& extension_id, bool enabled) { 1459 std::string extension_id, bool enabled) {
Finnur 2011/11/10 21:48:44 I wonder if people will be tempted to change this
1460 const Extension* extension = GetInstalledExtension(extension_id); 1460 const Extension* extension = GetInstalledExtension(extension_id);
1461 if (extension && extension->location() == Extension::COMPONENT) { 1461 if (extension && extension->location() == Extension::COMPONENT) {
1462 // This shouldn't be called for component extensions. 1462 // This shouldn't be called for component extensions.
1463 NOTREACHED(); 1463 NOTREACHED();
1464 return; 1464 return;
1465 } 1465 }
1466 1466
1467 // Broadcast unloaded and loaded events to update browser state. Only bother 1467 // Broadcast unloaded and loaded events to update browser state. Only bother
1468 // if the value changed and the extension is actually enabled, since there is 1468 // if the value changed and the extension is actually enabled, since there is
1469 // no UI otherwise. 1469 // no UI otherwise.
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 2490
2491 ExtensionService::NaClModuleInfoList::iterator 2491 ExtensionService::NaClModuleInfoList::iterator
2492 ExtensionService::FindNaClModule(const GURL& url) { 2492 ExtensionService::FindNaClModule(const GURL& url) {
2493 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 2493 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
2494 iter != nacl_module_list_.end(); ++iter) { 2494 iter != nacl_module_list_.end(); ++iter) {
2495 if (iter->url == url) 2495 if (iter->url == url)
2496 return iter; 2496 return iter;
2497 } 2497 }
2498 return nacl_module_list_.end(); 2498 return nacl_module_list_.end();
2499 } 2499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698