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

Side by Side Diff: chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.cc

Issue 2858013002: PS - Showing permission prompt for activeTab (Closed)
Patch Set: Test - delegate is set and works Created 3 years, 7 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698