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

Side by Side Diff: chrome/browser/extensions/active_tab_permission_granter.h

Issue 17298002: Allow tabCapture API to be granted for chrome:// pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests.. how did it even work before? Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/active_tab_permission_granter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 20 matching lines...) Expand all
31 public: 31 public:
32 ActiveTabPermissionGranter(content::WebContents* web_contents, 32 ActiveTabPermissionGranter(content::WebContents* web_contents,
33 int tab_id, 33 int tab_id,
34 Profile* profile); 34 Profile* profile);
35 virtual ~ActiveTabPermissionGranter(); 35 virtual ~ActiveTabPermissionGranter();
36 36
37 // If |extension| has the activeTab or tabCapture permission, grants 37 // If |extension| has the activeTab or tabCapture permission, grants
38 // tab-specific permissions to it until the next page navigation or refresh. 38 // tab-specific permissions to it until the next page navigation or refresh.
39 void GrantIfRequested(const Extension* extension); 39 void GrantIfRequested(const Extension* extension);
40 40
41 // Returns true if |extension| has been granted tab-specific permissions
42 // for this tab.
43 bool IsGranted(const Extension* extension);
44
45 private: 41 private:
46 // content::WebContentsObserver implementation. 42 // content::WebContentsObserver implementation.
47 virtual void DidNavigateMainFrame( 43 virtual void DidNavigateMainFrame(
48 const content::LoadCommittedDetails& details, 44 const content::LoadCommittedDetails& details,
49 const content::FrameNavigateParams& params) OVERRIDE; 45 const content::FrameNavigateParams& params) OVERRIDE;
50 virtual void WebContentsDestroyed(content::WebContents* web_contents) 46 virtual void WebContentsDestroyed(content::WebContents* web_contents)
51 OVERRIDE; 47 OVERRIDE;
52 48
53 // content::NotificationObserver implementation. 49 // content::NotificationObserver implementation.
54 virtual void Observe(int type, 50 virtual void Observe(int type,
(...skipping 16 matching lines...) Expand all
71 67
72 // Listen to extension unloaded notifications. 68 // Listen to extension unloaded notifications.
73 content::NotificationRegistrar registrar_; 69 content::NotificationRegistrar registrar_;
74 70
75 DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionGranter); 71 DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionGranter);
76 }; 72 };
77 73
78 } // namespace extensions 74 } // namespace extensions
79 75
80 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_ 76 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/active_tab_permission_granter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698