| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 struct ViewHostMsg_DomMessage_Params; | 82 struct ViewHostMsg_DomMessage_Params; |
| 83 struct ViewHostMsg_FrameNavigate_Params; | 83 struct ViewHostMsg_FrameNavigate_Params; |
| 84 class WebNavigationObserver; | 84 class WebNavigationObserver; |
| 85 struct WebPreferences; | 85 struct WebPreferences; |
| 86 | 86 |
| 87 // Describes what goes in the main content area of a tab. TabContents is | 87 // Describes what goes in the main content area of a tab. TabContents is |
| 88 // the only type of TabContents, and these should be merged together. | 88 // the only type of TabContents, and these should be merged together. |
| 89 class TabContents : public PageNavigator, | 89 class TabContents : public PageNavigator, |
| 90 public NotificationObserver, | 90 public NotificationObserver, |
| 91 public RenderViewHostDelegate, | 91 public RenderViewHostDelegate, |
| 92 public RenderViewHostDelegate::BrowserIntegration, | |
| 93 public RenderViewHostManager::Delegate, | 92 public RenderViewHostManager::Delegate, |
| 94 public JavaScriptAppModalDialogDelegate, | 93 public JavaScriptAppModalDialogDelegate, |
| 95 public ImageLoadingTracker::Observer, | 94 public ImageLoadingTracker::Observer, |
| 96 public TabSpecificContentSettings::Delegate { | 95 public TabSpecificContentSettings::Delegate { |
| 97 public: | 96 public: |
| 98 // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it | 97 // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it |
| 99 // what has changed. Combine them to update more than one thing. | 98 // what has changed. Combine them to update more than one thing. |
| 100 enum InvalidateTypes { | 99 enum InvalidateTypes { |
| 101 INVALIDATE_URL = 1 << 0, // The URL has changed. | 100 INVALIDATE_URL = 1 << 0, // The URL has changed. |
| 102 INVALIDATE_TAB = 1 << 1, // The favicon, app icon, or crashed | 101 INVALIDATE_TAB = 1 << 1, // The favicon, app icon, or crashed |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 private: | 756 private: |
| 758 friend class NavigationController; | 757 friend class NavigationController; |
| 759 // Used to access the child_windows_ (ConstrainedWindowList) for testing | 758 // Used to access the child_windows_ (ConstrainedWindowList) for testing |
| 760 // automation purposes. | 759 // automation purposes. |
| 761 friend class TestingAutomationProvider; | 760 friend class TestingAutomationProvider; |
| 762 | 761 |
| 763 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, NoJSMessageOnInterstitials); | 762 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, NoJSMessageOnInterstitials); |
| 764 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, UpdateTitle); | 763 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, UpdateTitle); |
| 765 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, CrossSiteCantPreemptAfterUnload); | 764 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, CrossSiteCantPreemptAfterUnload); |
| 766 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles); | 765 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles); |
| 766 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate); |
| 767 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload); |
| 767 | 768 |
| 768 // Temporary until the view/contents separation is complete. | 769 // Temporary until the view/contents separation is complete. |
| 769 friend class TabContentsView; | 770 friend class TabContentsView; |
| 770 #if defined(OS_WIN) | 771 #if defined(OS_WIN) |
| 771 friend class TabContentsViewWin; | 772 friend class TabContentsViewWin; |
| 772 #elif defined(OS_MACOSX) | 773 #elif defined(OS_MACOSX) |
| 773 friend class TabContentsViewMac; | 774 friend class TabContentsViewMac; |
| 774 #elif defined(TOOLKIT_USES_GTK) | 775 #elif defined(TOOLKIT_USES_GTK) |
| 775 friend class TabContentsViewGtk; | 776 friend class TabContentsViewGtk; |
| 776 #endif | 777 #endif |
| (...skipping 27 matching lines...) Expand all Loading... |
| 804 const std::string& main_frame_origin, | 805 const std::string& main_frame_origin, |
| 805 const std::string& security_info); | 806 const std::string& security_info); |
| 806 void OnDidDisplayInsecureContent(); | 807 void OnDidDisplayInsecureContent(); |
| 807 void OnDidRunInsecureContent(const std::string& security_origin, | 808 void OnDidRunInsecureContent(const std::string& security_origin, |
| 808 const GURL& target_url); | 809 const GURL& target_url); |
| 809 void OnDocumentLoadedInFrame(int64 frame_id); | 810 void OnDocumentLoadedInFrame(int64 frame_id); |
| 810 void OnDidFinishLoad(int64 frame_id); | 811 void OnDidFinishLoad(int64 frame_id); |
| 811 void OnUpdateContentRestrictions(int restrictions); | 812 void OnUpdateContentRestrictions(int restrictions); |
| 812 void OnPDFHasUnsupportedFeature(); | 813 void OnPDFHasUnsupportedFeature(); |
| 813 | 814 |
| 815 void OnFindReply(int request_id, |
| 816 int number_of_matches, |
| 817 const gfx::Rect& selection_rect, |
| 818 int active_match_ordinal, |
| 819 bool final_update); |
| 820 void OnGoToEntryAtOffset(int offset); |
| 821 void OnMissingPluginStatus(int status); |
| 822 void OnCrashedPlugin(const FilePath& plugin_path); |
| 823 void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info); |
| 824 void OnInstallApplication(const WebApplicationInfo& info); |
| 825 void OnBlockedOutdatedPlugin(const string16& name, const GURL& update_url); |
| 826 void OnPageContents(const GURL& url, |
| 827 int32 page_id, |
| 828 const string16& contents, |
| 829 const std::string& language, |
| 830 bool page_translatable); |
| 831 void OnPageTranslated(int32 page_id, |
| 832 const std::string& original_lang, |
| 833 const std::string& translated_lang, |
| 834 TranslateErrors::Type error_type); |
| 835 void OnSetSuggestions(int32 page_id, |
| 836 const std::vector<std::string>& suggestions); |
| 837 void OnInstantSupportDetermined(int32 page_id, bool result); |
| 838 |
| 814 // Changes the IsLoading state and notifies delegate as needed | 839 // Changes the IsLoading state and notifies delegate as needed |
| 815 // |details| is used to provide details on the load that just finished | 840 // |details| is used to provide details on the load that just finished |
| 816 // (but can be null if not applicable). Can be overridden. | 841 // (but can be null if not applicable). Can be overridden. |
| 817 void SetIsLoading(bool is_loading, | 842 void SetIsLoading(bool is_loading, |
| 818 LoadNotificationDetails* details); | 843 LoadNotificationDetails* details); |
| 819 | 844 |
| 820 // Adds the incoming |new_contents| to the |blocked_contents_| container. | 845 // Adds the incoming |new_contents| to the |blocked_contents_| container. |
| 821 void AddPopup(TabContents* new_contents, | 846 void AddPopup(TabContents* new_contents, |
| 822 const gfx::Rect& initial_pos); | 847 const gfx::Rect& initial_pos); |
| 823 | 848 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 | 934 |
| 910 // If params has a searchable form, this tries to create a new keyword. | 935 // If params has a searchable form, this tries to create a new keyword. |
| 911 void GenerateKeywordIfNecessary( | 936 void GenerateKeywordIfNecessary( |
| 912 const ViewHostMsg_FrameNavigate_Params& params); | 937 const ViewHostMsg_FrameNavigate_Params& params); |
| 913 | 938 |
| 914 // TabSpecificContentSettings::Delegate implementation. | 939 // TabSpecificContentSettings::Delegate implementation. |
| 915 virtual void OnContentSettingsAccessed(bool content_was_blocked); | 940 virtual void OnContentSettingsAccessed(bool content_was_blocked); |
| 916 | 941 |
| 917 // RenderViewHostDelegate ---------------------------------------------------- | 942 // RenderViewHostDelegate ---------------------------------------------------- |
| 918 | 943 |
| 919 // RenderViewHostDelegate::BrowserIntegration implementation. | |
| 920 virtual void OnUserGesture(); | |
| 921 virtual void OnFindReply(int request_id, | |
| 922 int number_of_matches, | |
| 923 const gfx::Rect& selection_rect, | |
| 924 int active_match_ordinal, | |
| 925 bool final_update); | |
| 926 virtual void GoToEntryAtOffset(int offset); | |
| 927 virtual void OnMissingPluginStatus(int status); | |
| 928 virtual void OnCrashedPlugin(const FilePath& plugin_path); | |
| 929 virtual void OnCrashedWorker(); | |
| 930 virtual void OnDidGetApplicationInfo(int32 page_id, | |
| 931 const WebApplicationInfo& info); | |
| 932 virtual void OnInstallApplication(const WebApplicationInfo& info); | |
| 933 virtual void OnBlockedOutdatedPlugin(const string16& name, | |
| 934 const GURL& update_url); | |
| 935 virtual void OnPageContents(const GURL& url, | |
| 936 int renderer_process_id, | |
| 937 int32 page_id, | |
| 938 const string16& contents, | |
| 939 const std::string& language, | |
| 940 bool page_translatable); | |
| 941 virtual void OnPageTranslated(int32 page_id, | |
| 942 const std::string& original_lang, | |
| 943 const std::string& translated_lang, | |
| 944 TranslateErrors::Type error_type); | |
| 945 virtual void OnSetSuggestions(int32 page_id, | |
| 946 const std::vector<std::string>& suggestions); | |
| 947 virtual void OnInstantSupportDetermined(int32 page_id, bool result); | |
| 948 | |
| 949 // RenderViewHostDelegate implementation. | 944 // RenderViewHostDelegate implementation. |
| 950 virtual RenderViewHostDelegate::View* GetViewDelegate(); | 945 virtual RenderViewHostDelegate::View* GetViewDelegate(); |
| 951 virtual RenderViewHostDelegate::RendererManagement* | 946 virtual RenderViewHostDelegate::RendererManagement* |
| 952 GetRendererManagementDelegate(); | 947 GetRendererManagementDelegate(); |
| 953 virtual RenderViewHostDelegate::BrowserIntegration* | |
| 954 GetBrowserIntegrationDelegate(); | |
| 955 virtual RenderViewHostDelegate::ContentSettings* GetContentSettingsDelegate(); | 948 virtual RenderViewHostDelegate::ContentSettings* GetContentSettingsDelegate(); |
| 956 virtual RenderViewHostDelegate::Save* GetSaveDelegate(); | 949 virtual RenderViewHostDelegate::Save* GetSaveDelegate(); |
| 957 virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); | 950 virtual RenderViewHostDelegate::Printing* GetPrintingDelegate(); |
| 958 virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate(); | 951 virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate(); |
| 959 virtual RenderViewHostDelegate::SSL* GetSSLDelegate(); | 952 virtual RenderViewHostDelegate::SSL* GetSSLDelegate(); |
| 960 virtual RenderViewHostDelegate::FileSelect* GetFileSelectDelegate(); | 953 virtual RenderViewHostDelegate::FileSelect* GetFileSelectDelegate(); |
| 961 virtual AutomationResourceRoutingDelegate* | 954 virtual AutomationResourceRoutingDelegate* |
| 962 GetAutomationResourceRoutingDelegate(); | 955 GetAutomationResourceRoutingDelegate(); |
| 963 virtual TabContents* GetAsTabContents(); | 956 virtual TabContents* GetAsTabContents(); |
| 964 virtual ViewType::Type GetRenderViewType() const; | 957 virtual ViewType::Type GetRenderViewType() const; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, | 1006 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
| 1014 const std::string& json_arguments, | 1007 const std::string& json_arguments, |
| 1015 IPC::Message* reply_msg); | 1008 IPC::Message* reply_msg); |
| 1016 virtual void PageHasOSDD(RenderViewHost* render_view_host, | 1009 virtual void PageHasOSDD(RenderViewHost* render_view_host, |
| 1017 int32 page_id, | 1010 int32 page_id, |
| 1018 const GURL& url, | 1011 const GURL& url, |
| 1019 const ViewHostMsg_PageHasOSDD_Type& provider_type); | 1012 const ViewHostMsg_PageHasOSDD_Type& provider_type); |
| 1020 virtual GURL GetAlternateErrorPageURL() const; | 1013 virtual GURL GetAlternateErrorPageURL() const; |
| 1021 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; | 1014 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; |
| 1022 virtual WebPreferences GetWebkitPrefs(); | 1015 virtual WebPreferences GetWebkitPrefs(); |
| 1016 virtual void OnUserGesture(); |
| 1023 virtual void OnIgnoredUIEvent(); | 1017 virtual void OnIgnoredUIEvent(); |
| 1024 virtual void OnJSOutOfMemory(); | 1018 virtual void OnJSOutOfMemory(); |
| 1025 virtual void OnCrossSiteResponse(int new_render_process_host_id, | 1019 virtual void OnCrossSiteResponse(int new_render_process_host_id, |
| 1026 int new_request_id); | 1020 int new_request_id); |
| 1027 virtual void RendererUnresponsive(RenderViewHost* render_view_host, | 1021 virtual void RendererUnresponsive(RenderViewHost* render_view_host, |
| 1028 bool is_during_unload); | 1022 bool is_during_unload); |
| 1029 virtual void RendererResponsive(RenderViewHost* render_view_host); | 1023 virtual void RendererResponsive(RenderViewHost* render_view_host); |
| 1030 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, | 1024 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, |
| 1031 uint64 upload_position, uint64 upload_size); | 1025 uint64 upload_position, uint64 upload_size); |
| 1032 virtual bool IsExternalTabContainer() const; | 1026 virtual bool IsExternalTabContainer() const; |
| 1033 virtual void DidInsertCSS(); | 1027 virtual void DidInsertCSS(); |
| 1034 virtual void FocusedNodeChanged(bool is_editable_node); | 1028 virtual void FocusedNodeChanged(bool is_editable_node); |
| 1035 virtual void UpdateZoomLimits(int minimum_percent, | 1029 virtual void UpdateZoomLimits(int minimum_percent, |
| 1036 int maximum_percent, | 1030 int maximum_percent, |
| 1037 bool remember); | 1031 bool remember); |
| 1032 virtual void WorkerCrashed(); |
| 1038 | 1033 |
| 1039 // RenderViewHostManager::Delegate ------------------------------------------- | 1034 // RenderViewHostManager::Delegate ------------------------------------------- |
| 1040 | 1035 |
| 1041 // Blocks/unblocks interaction with renderer process. | 1036 // Blocks/unblocks interaction with renderer process. |
| 1042 void BlockTabContent(bool blocked); | 1037 void BlockTabContent(bool blocked); |
| 1043 | 1038 |
| 1044 virtual void BeforeUnloadFiredFromRenderManager( | 1039 virtual void BeforeUnloadFiredFromRenderManager( |
| 1045 bool proceed, | 1040 bool proceed, |
| 1046 bool* proceed_to_fire_unload); | 1041 bool* proceed_to_fire_unload); |
| 1047 virtual void DidStartLoadingFromRenderManager( | 1042 virtual void DidStartLoadingFromRenderManager( |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 ObserverList<WebNavigationObserver> web_navigation_observers_; | 1335 ObserverList<WebNavigationObserver> web_navigation_observers_; |
| 1341 | 1336 |
| 1342 // Content restrictions, used to disable print/copy etc based on content's | 1337 // Content restrictions, used to disable print/copy etc based on content's |
| 1343 // (full-page plugins for now only) permissions. | 1338 // (full-page plugins for now only) permissions. |
| 1344 int content_restrictions_; | 1339 int content_restrictions_; |
| 1345 | 1340 |
| 1346 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1341 DISALLOW_COPY_AND_ASSIGN(TabContents); |
| 1347 }; | 1342 }; |
| 1348 | 1343 |
| 1349 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1344 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| OLD | NEW |