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

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

Issue 842523002: base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck2: withoutandroidchange Created 5 years, 11 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_reenabler.h" 5 #include "chrome/browser/extensions/extension_reenabler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/webstore_data_fetcher.h" 9 #include "chrome/browser/extensions/webstore_data_fetcher.h"
10 #include "chrome/browser/extensions/webstore_inline_installer.h" 10 #include "chrome/browser/extensions/webstore_inline_installer.h"
(...skipping 11 matching lines...) Expand all
22 Finish(ABORTED); 22 Finish(ABORTED);
23 } 23 }
24 24
25 // static 25 // static
26 scoped_ptr<ExtensionReenabler> ExtensionReenabler::PromptForReenable( 26 scoped_ptr<ExtensionReenabler> ExtensionReenabler::PromptForReenable(
27 const scoped_refptr<const Extension>& extension, 27 const scoped_refptr<const Extension>& extension,
28 content::BrowserContext* browser_context, 28 content::BrowserContext* browser_context,
29 content::WebContents* web_contents, 29 content::WebContents* web_contents,
30 const GURL& referrer_url, 30 const GURL& referrer_url,
31 const Callback& callback) { 31 const Callback& callback) {
32 #if DCHECK_IS_ON 32 #if DCHECK_IS_ON()
33 // We should only try to reenable an extension that is, in fact, disabled. 33 // We should only try to reenable an extension that is, in fact, disabled.
34 DCHECK(ExtensionRegistry::Get(browser_context)->disabled_extensions(). 34 DCHECK(ExtensionRegistry::Get(browser_context)->disabled_extensions().
35 Contains(extension->id())); 35 Contains(extension->id()));
36 // Currently, this should only be used for extensions that are disabled due 36 // Currently, this should only be used for extensions that are disabled due
37 // to a permissions increase. 37 // to a permissions increase.
38 int disable_reasons = 38 int disable_reasons =
39 ExtensionPrefs::Get(browser_context)->GetDisableReasons(extension->id()); 39 ExtensionPrefs::Get(browser_context)->GetDisableReasons(extension->id());
40 DCHECK_NE(0, disable_reasons & Extension::DISABLE_PERMISSIONS_INCREASE); 40 DCHECK_NE(0, disable_reasons & Extension::DISABLE_PERMISSIONS_INCREASE);
41 #endif // DCHECK_IS_ON 41 #endif // DCHECK_IS_ON()
42 42
43 return make_scoped_ptr(new ExtensionReenabler( 43 return make_scoped_ptr(new ExtensionReenabler(
44 extension, 44 extension,
45 browser_context, 45 browser_context,
46 referrer_url, 46 referrer_url,
47 callback, 47 callback,
48 make_scoped_ptr(new ExtensionInstallPrompt(web_contents)))); 48 make_scoped_ptr(new ExtensionInstallPrompt(web_contents))));
49 } 49 }
50 50
51 // static 51 // static
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 void ExtensionReenabler::Finish(ReenableResult result) { 156 void ExtensionReenabler::Finish(ReenableResult result) {
157 DCHECK(!finished_); 157 DCHECK(!finished_);
158 finished_ = true; 158 finished_ = true;
159 registry_observer_.RemoveAll(); 159 registry_observer_.RemoveAll();
160 callback_.Run(result); 160 callback_.Run(result);
161 } 161 }
162 162
163 } // namespace extensions 163 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698