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

Side by Side Diff: chrome/browser/content_settings/permission_context_base.h

Issue 769103002: Refactor ProtectedMediaIdentifierPermissionContext to derive from PermissionContextBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup and fix compile Created 6 years 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ 6 #define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/containers/scoped_ptr_hash_map.h" 9 #include "base/containers/scoped_ptr_hash_map.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // Implementors can override this method to update the icons on the 103 // Implementors can override this method to update the icons on the
104 // url bar with the result of the new permission. 104 // url bar with the result of the new permission.
105 virtual void UpdateTabContext(const PermissionRequestID& id, 105 virtual void UpdateTabContext(const PermissionRequestID& id,
106 const GURL& requesting_origin, 106 const GURL& requesting_origin,
107 bool allowed) {} 107 bool allowed) {}
108 108
109 // Return an instance of the infobar queue controller, creating it if needed. 109 // Return an instance of the infobar queue controller, creating it if needed.
110 PermissionQueueController* GetQueueController(); 110 PermissionQueueController* GetQueueController();
111 111
112 // Returns the profile associated with this permission context.
113 Profile* GetProfile() const;
mlamouri (slow - plz ping) 2014/12/02 22:43:30 It's a getter, per coding style it should be |prof
timvolodine 2014/12/03 16:44:25 Done.
114
112 // Store the decided permission as a content setting. 115 // Store the decided permission as a content setting.
113 // virtual since the permission might be stored with different restrictions 116 // virtual since the permission might be stored with different restrictions
114 // (for example for desktop notifications). 117 // (for example for desktop notifications).
115 virtual void UpdateContentSetting(const GURL& requesting_origin, 118 virtual void UpdateContentSetting(const GURL& requesting_origin,
116 const GURL& embedding_origin, 119 const GURL& embedding_origin,
117 bool allowed); 120 bool allowed);
118 121
119 private: 122 private:
120 // Called when a bubble is no longer used so it can be cleaned up. 123 // Called when a bubble is no longer used so it can be cleaned up.
121 void CleanUpBubble(const PermissionRequestID& id); 124 void CleanUpBubble(const PermissionRequestID& id);
122 125
123 Profile* profile_; 126 Profile* profile_;
124 const ContentSettingsType permission_type_; 127 const ContentSettingsType permission_type_;
125 scoped_ptr<PermissionQueueController> permission_queue_controller_; 128 scoped_ptr<PermissionQueueController> permission_queue_controller_;
126 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> 129 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest>
127 pending_bubbles_; 130 pending_bubbles_;
128 131
129 // Must be the last member, to ensure that it will be 132 // Must be the last member, to ensure that it will be
130 // destroyed first, which will invalidate weak pointers 133 // destroyed first, which will invalidate weak pointers
131 base::WeakPtrFactory<PermissionContextBase> weak_factory_; 134 base::WeakPtrFactory<PermissionContextBase> weak_factory_;
132 }; 135 };
133 136
134 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ 137 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698