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

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

Issue 11307020: Cleanup: Simplify some extensions / content_settings Observer code by simply DCHECKING instead of u… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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) 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_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 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2584 2584
2585 process_map_.RemoveAllFromProcess(process->GetID()); 2585 process_map_.RemoveAllFromProcess(process->GetID());
2586 BrowserThread::PostTask( 2586 BrowserThread::PostTask(
2587 BrowserThread::IO, FROM_HERE, 2587 BrowserThread::IO, FROM_HERE,
2588 base::Bind(&ExtensionInfoMap::UnregisterAllExtensionsInProcess, 2588 base::Bind(&ExtensionInfoMap::UnregisterAllExtensionsInProcess,
2589 system_->info_map(), 2589 system_->info_map(),
2590 process->GetID())); 2590 process->GetID()));
2591 break; 2591 break;
2592 } 2592 }
2593 case chrome::NOTIFICATION_PREF_CHANGED: { 2593 case chrome::NOTIFICATION_PREF_CHANGED: {
2594 std::string* pref_name = content::Details<std::string>(details).ptr(); 2594 const std::string& pref_name =
2595 if (*pref_name == prefs::kExtensionInstallAllowList || 2595 *content::Details<std::string>(details).ptr();
2596 *pref_name == prefs::kExtensionInstallDenyList) { 2596 DCHECK(pref_name == prefs::kExtensionInstallAllowList ||
2597 IdentifyAlertableExtensions(); 2597 pref_name == prefs::kExtensionInstallDenyList);
Yoyo Zhou 2012/10/27 15:45:03 You can still emit the NOTREACHED message from the
Lei Zhang 2012/10/30 00:01:45 Done. I will also output |pref_name| so the error
2598 CheckManagementPolicy(); 2598 IdentifyAlertableExtensions();
2599 } else { 2599 CheckManagementPolicy();
2600 NOTREACHED() << "Unexpected preference name.";
2601 }
2602 break; 2600 break;
2603 } 2601 }
2604 case chrome::NOTIFICATION_IMPORT_FINISHED: { 2602 case chrome::NOTIFICATION_IMPORT_FINISHED: {
2605 InitAfterImport(); 2603 InitAfterImport();
2606 break; 2604 break;
2607 } 2605 }
2608 2606
2609 default: 2607 default:
2610 NOTREACHED() << "Unexpected notification type."; 2608 NOTREACHED() << "Unexpected notification type.";
2611 } 2609 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
2834 // External extensions are initially disabled. We prompt the user before 2832 // External extensions are initially disabled. We prompt the user before
2835 // enabling them. 2833 // enabling them.
2836 if (Extension::IsExternalLocation(extension->location()) && 2834 if (Extension::IsExternalLocation(extension->location()) &&
2837 !extension_prefs_->IsExternalExtensionAcknowledged(extension->id())) { 2835 !extension_prefs_->IsExternalExtensionAcknowledged(extension->id())) {
2838 return false; 2836 return false;
2839 } 2837 }
2840 } 2838 }
2841 2839
2842 return true; 2840 return true;
2843 } 2841 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698