Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/extensions/active_tab_permission_granter_deleg ate_chromeos.h" | |
| 6 | |
| 7 #include "chrome/browser/chromeos/extensions/public_session_permission_helper.h" | |
| 8 #include "chrome/browser/profiles/profiles_state.h" | |
| 9 #include "extensions/common/extension.h" | |
| 10 #include "extensions/common/permissions/api_permission.h" | |
| 11 | |
| 12 namespace extensions { | |
| 13 | |
| 14 ActiveTabPermissionGranterDelegateChromeOS:: | |
| 15 ActiveTabPermissionGranterDelegateChromeOS() {} | |
| 16 | |
| 17 ActiveTabPermissionGranterDelegateChromeOS:: | |
| 18 ~ActiveTabPermissionGranterDelegateChromeOS() {} | |
| 19 | |
| 20 bool ActiveTabPermissionGranterDelegateChromeOS::ShouldGrantActiveTab( | |
| 21 const Extension* extension, | |
| 22 content::WebContents* web_contents) { | |
| 23 bool already_handled = permission_helper::HandlePermissionRequest( | |
| 24 *extension, {APIPermission::kActiveTab}, web_contents, | |
| 25 permission_helper::RequestResolvedCallback(), | |
| 26 permission_helper::PromptFactory()); | |
| 27 | |
| 28 if (already_handled) { | |
|
Devlin
2017/05/23 19:28:03
nit:
return already_handled &&
permission_h
Ivan Šandrk
2017/05/24 09:29:01
Done.
| |
| 29 return permission_helper::PermissionAllowed( | |
| 30 extension, APIPermission::kActiveTab); | |
| 31 } | |
| 32 | |
| 33 return false; | |
| 34 } | |
| 35 | |
| 36 } // namespace extensions | |
| OLD | NEW |