OLD | NEW |
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_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // Resets the |content_blocked_| and |content_allowed_| arrays, except for | 152 // Resets the |content_blocked_| and |content_allowed_| arrays, except for |
153 // CONTENT_SETTINGS_TYPE_COOKIES related information. | 153 // CONTENT_SETTINGS_TYPE_COOKIES related information. |
154 void ClearBlockedContentSettingsExceptForCookies(); | 154 void ClearBlockedContentSettingsExceptForCookies(); |
155 | 155 |
156 // Resets all cookies related information. | 156 // Resets all cookies related information. |
157 void ClearCookieSpecificContentSettings(); | 157 void ClearCookieSpecificContentSettings(); |
158 | 158 |
159 // Clears the Geolocation settings. | 159 // Clears the Geolocation settings. |
160 void ClearGeolocationContentSettings(); | 160 void ClearGeolocationContentSettings(); |
161 | 161 |
| 162 // Clears the MIDI settings. |
| 163 void ClearMIDIContentSettings(); |
| 164 |
162 // Changes the |content_blocked_| entry for popups. | 165 // Changes the |content_blocked_| entry for popups. |
163 void SetPopupsBlocked(bool blocked); | 166 void SetPopupsBlocked(bool blocked); |
164 | 167 |
165 // Changes the |content_blocked_| entry for downloads. | 168 // Changes the |content_blocked_| entry for downloads. |
166 void SetDownloadsBlocked(bool blocked); | 169 void SetDownloadsBlocked(bool blocked); |
167 | 170 |
168 // Updates Geolocation settings on navigation. | 171 // Updates Geolocation settings on navigation. |
169 void GeolocationDidNavigate( | 172 void GeolocationDidNavigate( |
170 const content::LoadCommittedDetails& details); | 173 const content::LoadCommittedDetails& details); |
171 | 174 |
| 175 // Updates MIDI settings on navigation. |
| 176 void MIDIDidNavigate(const content::LoadCommittedDetails& details); |
| 177 |
172 // Returns whether a particular kind of content has been blocked for this | 178 // Returns whether a particular kind of content has been blocked for this |
173 // page. | 179 // page. |
174 bool IsContentBlocked(ContentSettingsType content_type) const; | 180 bool IsContentBlocked(ContentSettingsType content_type) const; |
175 | 181 |
176 // Returns true if content blockage was indicated to the user. | 182 // Returns true if content blockage was indicated to the user. |
177 bool IsBlockageIndicated(ContentSettingsType content_type) const; | 183 bool IsBlockageIndicated(ContentSettingsType content_type) const; |
178 | 184 |
179 void SetBlockageHasBeenIndicated(ContentSettingsType content_type); | 185 void SetBlockageHasBeenIndicated(ContentSettingsType content_type); |
180 | 186 |
181 // Returns whether a particular kind of content has been allowed. Currently | 187 // Returns whether a particular kind of content has been allowed. Currently |
182 // only tracks cookies. | 188 // only tracks cookies. |
183 bool IsContentAllowed(ContentSettingsType content_type) const; | 189 bool IsContentAllowed(ContentSettingsType content_type) const; |
184 | 190 |
185 // Returns the state of the camera and microphone usage. | 191 // Returns the state of the camera and microphone usage. |
186 MicrophoneCameraState GetMicrophoneCameraState() const; | 192 MicrophoneCameraState GetMicrophoneCameraState() const; |
187 | 193 |
188 const std::set<std::string>& BlockedResourcesForType( | 194 const std::set<std::string>& BlockedResourcesForType( |
189 ContentSettingsType content_type) const; | 195 ContentSettingsType content_type) const; |
190 | 196 |
191 // Returns the ContentSettingsUsagesState that controls the | 197 // Returns the ContentSettingsUsagesState that controls the |
192 // geolocation API usage on this page. | 198 // geolocation API usage on this page. |
193 const ContentSettingsUsagesState& geolocation_usages_state() const { | 199 const ContentSettingsUsagesState& geolocation_usages_state() const { |
194 return geolocation_usages_state_; | 200 return geolocation_usages_state_; |
195 } | 201 } |
196 | 202 |
| 203 // Returns the ContentSettingsUsageState that controls the MIDI usage on |
| 204 // this page. |
| 205 const ContentSettingsUsagesState& midi_usages_state() const { |
| 206 return midi_usages_state_; |
| 207 } |
| 208 |
197 // Call to indicate that there is a protocol handler pending user approval. | 209 // Call to indicate that there is a protocol handler pending user approval. |
198 void set_pending_protocol_handler(const ProtocolHandler& handler) { | 210 void set_pending_protocol_handler(const ProtocolHandler& handler) { |
199 pending_protocol_handler_ = handler; | 211 pending_protocol_handler_ = handler; |
200 } | 212 } |
201 | 213 |
202 const ProtocolHandler& pending_protocol_handler() const { | 214 const ProtocolHandler& pending_protocol_handler() const { |
203 return pending_protocol_handler_; | 215 return pending_protocol_handler_; |
204 } | 216 } |
205 | 217 |
206 void ClearPendingProtocolHandler() { | 218 void ClearPendingProtocolHandler() { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 void OnLocalStorageAccessed(const GURL& url, | 303 void OnLocalStorageAccessed(const GURL& url, |
292 bool local, | 304 bool local, |
293 bool blocked_by_policy); | 305 bool blocked_by_policy); |
294 void OnWebDatabaseAccessed(const GURL& url, | 306 void OnWebDatabaseAccessed(const GURL& url, |
295 const string16& name, | 307 const string16& name, |
296 const string16& display_name, | 308 const string16& display_name, |
297 bool blocked_by_policy); | 309 bool blocked_by_policy); |
298 void OnGeolocationPermissionSet(const GURL& requesting_frame, | 310 void OnGeolocationPermissionSet(const GURL& requesting_frame, |
299 bool allowed); | 311 bool allowed); |
300 | 312 |
301 | |
302 // These methods are called to update the status about the microphone and | 313 // These methods are called to update the status about the microphone and |
303 // camera stream access. | 314 // camera stream access. |
304 void OnMicrophoneAccessed(); | 315 void OnMicrophoneAccessed(); |
305 void OnMicrophoneAccessBlocked(); | 316 void OnMicrophoneAccessBlocked(); |
306 void OnCameraAccessed(); | 317 void OnCameraAccessed(); |
307 void OnCameraAccessBlocked(); | 318 void OnCameraAccessBlocked(); |
308 | 319 |
| 320 // There methods are called to update the status about MIDI access. |
| 321 void OnMIDISysExAccessed(const GURL& reqesting_origin); |
| 322 void OnMIDISysExAccessBlocked(const GURL& requesting_origin); |
| 323 |
309 // Adds the given |SiteDataObserver|. The |observer| is notified when a | 324 // Adds the given |SiteDataObserver|. The |observer| is notified when a |
310 // locale shared object, like for example a cookie, is accessed. | 325 // locale shared object, like for example a cookie, is accessed. |
311 void AddSiteDataObserver(SiteDataObserver* observer); | 326 void AddSiteDataObserver(SiteDataObserver* observer); |
312 | 327 |
313 // Removes the given |SiteDataObserver|. | 328 // Removes the given |SiteDataObserver|. |
314 void RemoveSiteDataObserver(SiteDataObserver* observer); | 329 void RemoveSiteDataObserver(SiteDataObserver* observer); |
315 | 330 |
316 private: | 331 private: |
317 explicit TabSpecificContentSettings(content::WebContents* tab); | 332 explicit TabSpecificContentSettings(content::WebContents* tab); |
318 friend class content::WebContentsUserData<TabSpecificContentSettings>; | 333 friend class content::WebContentsUserData<TabSpecificContentSettings>; |
(...skipping 29 matching lines...) Expand all Loading... |
348 // The profile of the tab. | 363 // The profile of the tab. |
349 Profile* profile_; | 364 Profile* profile_; |
350 | 365 |
351 // Stores the blocked/allowed cookies. | 366 // Stores the blocked/allowed cookies. |
352 LocalSharedObjectsContainer allowed_local_shared_objects_; | 367 LocalSharedObjectsContainer allowed_local_shared_objects_; |
353 LocalSharedObjectsContainer blocked_local_shared_objects_; | 368 LocalSharedObjectsContainer blocked_local_shared_objects_; |
354 | 369 |
355 // Manages information about Geolocation API usage in this page. | 370 // Manages information about Geolocation API usage in this page. |
356 ContentSettingsUsagesState geolocation_usages_state_; | 371 ContentSettingsUsagesState geolocation_usages_state_; |
357 | 372 |
| 373 // Manages information about MIDI usages in this page. |
| 374 ContentSettingsUsagesState midi_usages_state_; |
| 375 |
358 // The pending protocol handler, if any. This can be set if | 376 // The pending protocol handler, if any. This can be set if |
359 // registerProtocolHandler was invoked without user gesture. | 377 // registerProtocolHandler was invoked without user gesture. |
360 // The |IsEmpty| method will be true if no protocol handler is | 378 // The |IsEmpty| method will be true if no protocol handler is |
361 // pending registration. | 379 // pending registration. |
362 ProtocolHandler pending_protocol_handler_; | 380 ProtocolHandler pending_protocol_handler_; |
363 | 381 |
364 // The previous protocol handler to be replaced by | 382 // The previous protocol handler to be replaced by |
365 // the pending_protocol_handler_, if there is one. Empty if | 383 // the pending_protocol_handler_, if there is one. Empty if |
366 // there is no handler which would be replaced. | 384 // there is no handler which would be replaced. |
367 ProtocolHandler previous_protocol_handler_; | 385 ProtocolHandler previous_protocol_handler_; |
368 | 386 |
369 // The setting on the pending protocol handler registration. Persisted in case | 387 // The setting on the pending protocol handler registration. Persisted in case |
370 // the user opens the bubble and makes changes multiple times. | 388 // the user opens the bubble and makes changes multiple times. |
371 ContentSetting pending_protocol_handler_setting_; | 389 ContentSetting pending_protocol_handler_setting_; |
372 | 390 |
373 // Stores whether the user can load blocked plugins on this page. | 391 // Stores whether the user can load blocked plugins on this page. |
374 bool load_plugins_link_enabled_; | 392 bool load_plugins_link_enabled_; |
375 | 393 |
376 content::NotificationRegistrar registrar_; | 394 content::NotificationRegistrar registrar_; |
377 | 395 |
378 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 396 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
379 }; | 397 }; |
380 | 398 |
381 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 399 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
OLD | NEW |