| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/printing/print_view_manager.h" | 27 #include "chrome/browser/printing/print_view_manager.h" |
| 28 #include "chrome/browser/shell_dialogs.h" | 28 #include "chrome/browser/shell_dialogs.h" |
| 29 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 29 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 30 #include "chrome/browser/tab_contents/constrained_window.h" | 30 #include "chrome/browser/tab_contents/constrained_window.h" |
| 31 #include "chrome/browser/tab_contents/infobar_delegate.h" | 31 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 32 #include "chrome/browser/tab_contents/language_state.h" | 32 #include "chrome/browser/tab_contents/language_state.h" |
| 33 #include "chrome/browser/tab_contents/navigation_controller.h" | 33 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 34 #include "chrome/browser/tab_contents/navigation_entry.h" | 34 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 35 #include "chrome/browser/tab_contents/page_navigator.h" | 35 #include "chrome/browser/tab_contents/page_navigator.h" |
| 36 #include "chrome/browser/tab_contents/render_view_host_manager.h" | 36 #include "chrome/browser/tab_contents/render_view_host_manager.h" |
| 37 #include "chrome/common/content_settings.h" |
| 37 #include "chrome/common/content_settings_types.h" | 38 #include "chrome/common/content_settings_types.h" |
| 38 #include "chrome/common/extensions/url_pattern.h" | 39 #include "chrome/common/extensions/url_pattern.h" |
| 39 #include "chrome/common/navigation_types.h" | 40 #include "chrome/common/navigation_types.h" |
| 40 #include "chrome/common/notification_registrar.h" | 41 #include "chrome/common/notification_registrar.h" |
| 41 #include "chrome/common/property_bag.h" | 42 #include "chrome/common/property_bag.h" |
| 42 #include "chrome/common/renderer_preferences.h" | 43 #include "chrome/common/renderer_preferences.h" |
| 43 #include "gfx/native_widget_types.h" | 44 #include "gfx/native_widget_types.h" |
| 44 #include "gfx/rect.h" | 45 #include "gfx/rect.h" |
| 45 #include "net/base/load_states.h" | 46 #include "net/base/load_states.h" |
| 46 #include "webkit/glue/dom_operations.h" | 47 #include "webkit/glue/dom_operations.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 bool FavIconIsValid() const; | 241 bool FavIconIsValid() const; |
| 241 | 242 |
| 242 // Returns whether the favicon should be displayed. If this returns false, no | 243 // Returns whether the favicon should be displayed. If this returns false, no |
| 243 // space is provided for the favicon, and the favicon is never displayed. | 244 // space is provided for the favicon, and the favicon is never displayed. |
| 244 virtual bool ShouldDisplayFavIcon(); | 245 virtual bool ShouldDisplayFavIcon(); |
| 245 | 246 |
| 246 // Returns whether a particular kind of content has been blocked for this | 247 // Returns whether a particular kind of content has been blocked for this |
| 247 // page. | 248 // page. |
| 248 bool IsContentBlocked(ContentSettingsType content_type) const; | 249 bool IsContentBlocked(ContentSettingsType content_type) const; |
| 249 | 250 |
| 251 // Returns the map of settings per origin that has used the geolocation API on |
| 252 // this page. |
| 253 typedef std::map<GURL, ContentSetting> GeolocationContentSettings; |
| 254 const GeolocationContentSettings& geolocation_content_settings() const { |
| 255 return geolocation_content_settings_; |
| 256 } |
| 257 |
| 250 // Returns a human-readable description the tab's loading state. | 258 // Returns a human-readable description the tab's loading state. |
| 251 virtual std::wstring GetStatusText() const; | 259 virtual std::wstring GetStatusText() const; |
| 252 | 260 |
| 253 // Return whether this tab contents is loading a resource. | 261 // Return whether this tab contents is loading a resource. |
| 254 bool is_loading() const { return is_loading_; } | 262 bool is_loading() const { return is_loading_; } |
| 255 | 263 |
| 256 // Returns whether this tab contents is waiting for a first-response for the | 264 // Returns whether this tab contents is waiting for a first-response for the |
| 257 // main resource of the page. This controls whether the throbber state is | 265 // main resource of the page. This controls whether the throbber state is |
| 258 // "waiting" or "loading." | 266 // "waiting" or "loading." |
| 259 bool waiting_for_response() const { return waiting_for_response_; } | 267 bool waiting_for_response() const { return waiting_for_response_; } |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 | 702 |
| 695 // So InterstitialPage can access SetIsLoading. | 703 // So InterstitialPage can access SetIsLoading. |
| 696 friend class InterstitialPage; | 704 friend class InterstitialPage; |
| 697 | 705 |
| 698 // TODO(brettw) TestTabContents shouldn't exist! | 706 // TODO(brettw) TestTabContents shouldn't exist! |
| 699 friend class TestTabContents; | 707 friend class TestTabContents; |
| 700 | 708 |
| 701 // Resets the |content_blocked_| array. | 709 // Resets the |content_blocked_| array. |
| 702 void ClearBlockedContentSettings(); | 710 void ClearBlockedContentSettings(); |
| 703 | 711 |
| 712 // Resets the |geolocation_settings_| map. |
| 713 void ClearGeolocationContentSettings(); |
| 714 |
| 704 // Changes the IsLoading state and notifies delegate as needed | 715 // Changes the IsLoading state and notifies delegate as needed |
| 705 // |details| is used to provide details on the load that just finished | 716 // |details| is used to provide details on the load that just finished |
| 706 // (but can be null if not applicable). Can be overridden. | 717 // (but can be null if not applicable). Can be overridden. |
| 707 void SetIsLoading(bool is_loading, | 718 void SetIsLoading(bool is_loading, |
| 708 LoadNotificationDetails* details); | 719 LoadNotificationDetails* details); |
| 709 | 720 |
| 710 // Adds the incoming |new_contents| to the |blocked_popups_| container. | 721 // Adds the incoming |new_contents| to the |blocked_popups_| container. |
| 711 void AddPopup(TabContents* new_contents, | 722 void AddPopup(TabContents* new_contents, |
| 712 const gfx::Rect& initial_pos); | 723 const gfx::Rect& initial_pos); |
| 713 | 724 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 virtual void DidDisplayInsecureContent(); | 846 virtual void DidDisplayInsecureContent(); |
| 836 virtual void DidRunInsecureContent(const std::string& security_origin); | 847 virtual void DidRunInsecureContent(const std::string& security_origin); |
| 837 virtual void DidFailProvisionalLoadWithError( | 848 virtual void DidFailProvisionalLoadWithError( |
| 838 RenderViewHost* render_view_host, | 849 RenderViewHost* render_view_host, |
| 839 bool is_main_frame, | 850 bool is_main_frame, |
| 840 int error_code, | 851 int error_code, |
| 841 const GURL& url, | 852 const GURL& url, |
| 842 bool showing_repost_interstitial); | 853 bool showing_repost_interstitial); |
| 843 virtual void DocumentLoadedInFrame(); | 854 virtual void DocumentLoadedInFrame(); |
| 844 virtual void OnContentBlocked(ContentSettingsType type); | 855 virtual void OnContentBlocked(ContentSettingsType type); |
| 856 virtual void OnGeolocationPermissionSet(const GURL& requesting_origin, |
| 857 bool allowed); |
| 845 | 858 |
| 846 // RenderViewHostDelegate implementation. | 859 // RenderViewHostDelegate implementation. |
| 847 virtual RenderViewHostDelegate::View* GetViewDelegate(); | 860 virtual RenderViewHostDelegate::View* GetViewDelegate(); |
| 848 virtual RenderViewHostDelegate::RendererManagement* | 861 virtual RenderViewHostDelegate::RendererManagement* |
| 849 GetRendererManagementDelegate(); | 862 GetRendererManagementDelegate(); |
| 850 virtual RenderViewHostDelegate::BrowserIntegration* | 863 virtual RenderViewHostDelegate::BrowserIntegration* |
| 851 GetBrowserIntegrationDelegate(); | 864 GetBrowserIntegrationDelegate(); |
| 852 virtual RenderViewHostDelegate::Resource* GetResourceDelegate(); | 865 virtual RenderViewHostDelegate::Resource* GetResourceDelegate(); |
| 853 virtual RenderViewHostDelegate::Save* GetSaveDelegate(); | 866 virtual RenderViewHostDelegate::Save* GetSaveDelegate(); |
| 854 virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); | 867 virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 // profile | 1209 // profile |
| 1197 scoped_refptr<URLRequestContextGetter> request_context_; | 1210 scoped_refptr<URLRequestContextGetter> request_context_; |
| 1198 | 1211 |
| 1199 // If non-null this tab is an app tab and this is the extension the tab was | 1212 // If non-null this tab is an app tab and this is the extension the tab was |
| 1200 // created for. | 1213 // created for. |
| 1201 Extension* app_extension_; | 1214 Extension* app_extension_; |
| 1202 | 1215 |
| 1203 // Information about the language the page is in and has been translated to. | 1216 // Information about the language the page is in and has been translated to. |
| 1204 LanguageState language_state_; | 1217 LanguageState language_state_; |
| 1205 | 1218 |
| 1219 // Maps each frame on this page to its geolocation content settings. |
| 1220 GeolocationContentSettings geolocation_content_settings_; |
| 1221 |
| 1206 // --------------------------------------------------------------------------- | 1222 // --------------------------------------------------------------------------- |
| 1207 | 1223 |
| 1208 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1224 DISALLOW_COPY_AND_ASSIGN(TabContents); |
| 1209 }; | 1225 }; |
| 1210 | 1226 |
| 1211 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1227 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| OLD | NEW |