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

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

Issue 10535155: Hook the activeTab permission up to the omnibox, page action, and context menu APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
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_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 15 matching lines...) Expand all
26 class ActiveTabPermissionManager : public content::WebContentsObserver, 26 class ActiveTabPermissionManager : public content::WebContentsObserver,
27 public content::NotificationObserver { 27 public content::NotificationObserver {
28 public: 28 public:
29 explicit ActiveTabPermissionManager(TabContents* tab_contents); 29 explicit ActiveTabPermissionManager(TabContents* tab_contents);
30 virtual ~ActiveTabPermissionManager(); 30 virtual ~ActiveTabPermissionManager();
31 31
32 // If |extension| has the activeTab permission, grants tab-specific 32 // If |extension| has the activeTab permission, grants tab-specific
33 // permissions to it until the next page navigation or refresh. 33 // permissions to it until the next page navigation or refresh.
34 void GrantIfRequested(const Extension* extension); 34 void GrantIfRequested(const Extension* extension);
35 35
36 // Like above, except make this find the Extension with |extension_id|.
37 void GrantIfRequested(const std::string& extension_id);
Finnur 2012/06/14 10:53:00 I think the style guide doesn't like two functions
Aaron Boodman 2012/06/14 20:50:45 I think the styleguide allows for overloading in t
38
36 // content::WebContentsObserver implementation. 39 // content::WebContentsObserver implementation.
37 // 40 //
38 // This is public to be called from ActiveTabTest as a way to fake creating 41 // This is public to be called from ActiveTabTest as a way to fake creating
39 // frames on this tab. It's a bit fragile but there doesn't seem to be any 42 // frames on this tab. It's a bit fragile but there doesn't seem to be any
40 // other way to do it. 43 // other way to do it.
41 virtual void DidCommitProvisionalLoadForFrame( 44 virtual void DidCommitProvisionalLoadForFrame(
42 int64 frame_id, 45 int64 frame_id,
43 bool is_main_frame, 46 bool is_main_frame,
44 const GURL& url, 47 const GURL& url,
45 content::PageTransition transition_type, 48 content::PageTransition transition_type,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 87
85 // Listen to extension unloaded notifications. 88 // Listen to extension unloaded notifications.
86 content::NotificationRegistrar registrar_; 89 content::NotificationRegistrar registrar_;
87 90
88 DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionManager); 91 DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionManager);
89 }; 92 };
90 93
91 } // namespace extensions 94 } // namespace extensions
92 95
93 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_MANAGER_H_ 96 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_TAB_PERMISSION_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit.cc ('k') | chrome/browser/extensions/active_tab_permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698