| 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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 virtual void Stop() OVERRIDE; | 257 virtual void Stop() OVERRIDE; |
| 258 virtual WebContents* Clone() OVERRIDE; | 258 virtual WebContents* Clone() OVERRIDE; |
| 259 virtual void FocusThroughTabTraversal(bool reverse) OVERRIDE; | 259 virtual void FocusThroughTabTraversal(bool reverse) OVERRIDE; |
| 260 virtual bool ShowingInterstitialPage() const OVERRIDE; | 260 virtual bool ShowingInterstitialPage() const OVERRIDE; |
| 261 virtual InterstitialPage* GetInterstitialPage() const OVERRIDE; | 261 virtual InterstitialPage* GetInterstitialPage() const OVERRIDE; |
| 262 virtual bool IsSavable() OVERRIDE; | 262 virtual bool IsSavable() OVERRIDE; |
| 263 virtual void OnSavePage() OVERRIDE; | 263 virtual void OnSavePage() OVERRIDE; |
| 264 virtual bool SavePage(const base::FilePath& main_file, | 264 virtual bool SavePage(const base::FilePath& main_file, |
| 265 const base::FilePath& dir_path, | 265 const base::FilePath& dir_path, |
| 266 SavePageType save_type) OVERRIDE; | 266 SavePageType save_type) OVERRIDE; |
| 267 virtual void SaveFrame(const GURL& url, |
| 268 const Referrer& referrer) OVERRIDE; |
| 267 virtual void GenerateMHTML( | 269 virtual void GenerateMHTML( |
| 268 const base::FilePath& file, | 270 const base::FilePath& file, |
| 269 const base::Callback<void(const base::FilePath&, int64)>& callback) | 271 const base::Callback<void(const base::FilePath&, int64)>& callback) |
| 270 OVERRIDE; | 272 OVERRIDE; |
| 271 virtual bool IsActiveEntry(int32 page_id) OVERRIDE; | 273 virtual bool IsActiveEntry(int32 page_id) OVERRIDE; |
| 272 | 274 |
| 273 virtual const std::string& GetContentsMimeType() const OVERRIDE; | 275 virtual const std::string& GetContentsMimeType() const OVERRIDE; |
| 274 virtual bool WillNotifyDisconnection() const OVERRIDE; | 276 virtual bool WillNotifyDisconnection() const OVERRIDE; |
| 275 virtual void SetOverrideEncoding(const std::string& encoding) OVERRIDE; | 277 virtual void SetOverrideEncoding(const std::string& encoding) OVERRIDE; |
| 276 virtual void ResetOverrideEncoding() OVERRIDE; | 278 virtual void ResetOverrideEncoding() OVERRIDE; |
| 277 virtual RendererPreferences* GetMutableRendererPrefs() OVERRIDE; | 279 virtual RendererPreferences* GetMutableRendererPrefs() OVERRIDE; |
| 278 virtual void Close() OVERRIDE; | 280 virtual void Close() OVERRIDE; |
| 279 virtual void SystemDragEnded() OVERRIDE; | 281 virtual void SystemDragEnded() OVERRIDE; |
| 280 virtual void UserGestureDone() OVERRIDE; | 282 virtual void UserGestureDone() OVERRIDE; |
| 281 virtual void SetClosedByUserGesture(bool value) OVERRIDE; | 283 virtual void SetClosedByUserGesture(bool value) OVERRIDE; |
| 282 virtual bool GetClosedByUserGesture() const OVERRIDE; | 284 virtual bool GetClosedByUserGesture() const OVERRIDE; |
| 283 virtual double GetZoomLevel() const OVERRIDE; | 285 virtual double GetZoomLevel() const OVERRIDE; |
| 284 virtual int GetZoomPercent(bool* enable_increment, | 286 virtual int GetZoomPercent(bool* enable_increment, |
| 285 bool* enable_decrement) const OVERRIDE; | 287 bool* enable_decrement) const OVERRIDE; |
| 286 virtual void ViewSource() OVERRIDE; | 288 virtual void ViewSource() OVERRIDE; |
| 287 virtual void ViewFrameSource(const GURL& url, | 289 virtual void ViewFrameSource(const GURL& url, |
| 288 const PageState& page_state) OVERRIDE; | 290 const PageState& page_state) OVERRIDE; |
| 289 virtual int GetMinimumZoomPercent() const OVERRIDE; | 291 virtual int GetMinimumZoomPercent() const OVERRIDE; |
| 290 virtual int GetMaximumZoomPercent() const OVERRIDE; | 292 virtual int GetMaximumZoomPercent() const OVERRIDE; |
| 291 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 293 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 292 virtual int GetContentRestrictions() const OVERRIDE; | |
| 293 virtual bool GotResponseToLockMouseRequest(bool allowed) OVERRIDE; | 294 virtual bool GotResponseToLockMouseRequest(bool allowed) OVERRIDE; |
| 294 virtual bool HasOpener() const OVERRIDE; | 295 virtual bool HasOpener() const OVERRIDE; |
| 295 virtual void DidChooseColorInColorChooser(SkColor color) OVERRIDE; | 296 virtual void DidChooseColorInColorChooser(SkColor color) OVERRIDE; |
| 296 virtual void DidEndColorChooser() OVERRIDE; | 297 virtual void DidEndColorChooser() OVERRIDE; |
| 297 virtual int DownloadImage(const GURL& url, | 298 virtual int DownloadImage(const GURL& url, |
| 298 bool is_favicon, | 299 bool is_favicon, |
| 299 uint32_t preferred_image_size, | 300 uint32_t preferred_image_size, |
| 300 uint32_t max_image_size, | 301 uint32_t max_image_size, |
| 301 const ImageDownloadCallback& callback) OVERRIDE; | 302 const ImageDownloadCallback& callback) OVERRIDE; |
| 302 | 303 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 const GURL& target_url); | 565 const GURL& target_url); |
| 565 void OnDocumentLoadedInFrame(int64 frame_id); | 566 void OnDocumentLoadedInFrame(int64 frame_id); |
| 566 void OnDidFinishLoad(int64 frame_id, | 567 void OnDidFinishLoad(int64 frame_id, |
| 567 const GURL& url, | 568 const GURL& url, |
| 568 bool is_main_frame); | 569 bool is_main_frame); |
| 569 void OnDidFailLoadWithError(int64 frame_id, | 570 void OnDidFailLoadWithError(int64 frame_id, |
| 570 const GURL& url, | 571 const GURL& url, |
| 571 bool is_main_frame, | 572 bool is_main_frame, |
| 572 int error_code, | 573 int error_code, |
| 573 const string16& error_description); | 574 const string16& error_description); |
| 574 void OnUpdateContentRestrictions(int restrictions); | |
| 575 void OnGoToEntryAtOffset(int offset); | 575 void OnGoToEntryAtOffset(int offset); |
| 576 void OnUpdateZoomLimits(int minimum_percent, | 576 void OnUpdateZoomLimits(int minimum_percent, |
| 577 int maximum_percent, | 577 int maximum_percent, |
| 578 bool remember); | 578 bool remember); |
| 579 void OnSaveURL(const GURL& url, const Referrer& referrer); | |
| 580 void OnEnumerateDirectory(int request_id, const base::FilePath& path); | 579 void OnEnumerateDirectory(int request_id, const base::FilePath& path); |
| 581 void OnJSOutOfMemory(); | 580 void OnJSOutOfMemory(); |
| 582 | 581 |
| 583 void OnRegisterProtocolHandler(const std::string& protocol, | 582 void OnRegisterProtocolHandler(const std::string& protocol, |
| 584 const GURL& url, | 583 const GURL& url, |
| 585 const string16& title, | 584 const string16& title, |
| 586 bool user_gesture); | 585 bool user_gesture); |
| 587 void OnFindReply(int request_id, | 586 void OnFindReply(int request_id, |
| 588 int number_of_matches, | 587 int number_of_matches, |
| 589 const gfx::Rect& selection_rect, | 588 const gfx::Rect& selection_rect, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 // Misc non-view stuff ------------------------------------------------------- | 728 // Misc non-view stuff ------------------------------------------------------- |
| 730 | 729 |
| 731 // Helper functions for sending notifications. | 730 // Helper functions for sending notifications. |
| 732 void NotifySwapped(RenderViewHost* old_render_view_host); | 731 void NotifySwapped(RenderViewHost* old_render_view_host); |
| 733 void NotifyConnected(); | 732 void NotifyConnected(); |
| 734 void NotifyDisconnected(); | 733 void NotifyDisconnected(); |
| 735 void NotifyNavigationEntryCommitted(const LoadCommittedDetails& load_details); | 734 void NotifyNavigationEntryCommitted(const LoadCommittedDetails& load_details); |
| 736 | 735 |
| 737 void SetEncoding(const std::string& encoding); | 736 void SetEncoding(const std::string& encoding); |
| 738 | 737 |
| 739 // Save a URL to the local filesystem. | |
| 740 void SaveURL(const GURL& url, | |
| 741 const Referrer& referrer, | |
| 742 bool is_main_frame); | |
| 743 | |
| 744 RenderViewHostImpl* GetRenderViewHostImpl(); | 738 RenderViewHostImpl* GetRenderViewHostImpl(); |
| 745 | 739 |
| 746 FrameTreeNode* FindFrameTreeNodeByID(int64 frame_id); | 740 FrameTreeNode* FindFrameTreeNodeByID(int64 frame_id); |
| 747 | 741 |
| 748 // Removes browser plugin embedder if there is one. | 742 // Removes browser plugin embedder if there is one. |
| 749 void RemoveBrowserPluginEmbedder(); | 743 void RemoveBrowserPluginEmbedder(); |
| 750 | 744 |
| 751 // Clear |render_view_host|'s PowerSaveBlockers. | 745 // Clear |render_view_host|'s PowerSaveBlockers. |
| 752 void ClearPowerSaveBlockers(RenderViewHost* render_view_host); | 746 void ClearPowerSaveBlockers(RenderViewHost* render_view_host); |
| 753 | 747 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 int minimum_zoom_percent_; | 902 int minimum_zoom_percent_; |
| 909 int maximum_zoom_percent_; | 903 int maximum_zoom_percent_; |
| 910 // If true, the default zoom limits have been overriden for this tab, in which | 904 // If true, the default zoom limits have been overriden for this tab, in which |
| 911 // case we don't want saved settings to apply to it and we don't want to | 905 // case we don't want saved settings to apply to it and we don't want to |
| 912 // remember it. | 906 // remember it. |
| 913 bool temporary_zoom_settings_; | 907 bool temporary_zoom_settings_; |
| 914 | 908 |
| 915 // The intrinsic size of the page. | 909 // The intrinsic size of the page. |
| 916 gfx::Size preferred_size_; | 910 gfx::Size preferred_size_; |
| 917 | 911 |
| 918 // Content restrictions, used to disable print/copy etc based on content's | |
| 919 // (full-page plugins for now only) permissions. | |
| 920 int content_restrictions_; | |
| 921 | |
| 922 #if defined(OS_ANDROID) | 912 #if defined(OS_ANDROID) |
| 923 // Date time chooser opened by this tab. | 913 // Date time chooser opened by this tab. |
| 924 // Only used in Android since all other platforms use a multi field UI. | 914 // Only used in Android since all other platforms use a multi field UI. |
| 925 scoped_ptr<DateTimeChooserAndroid> date_time_chooser_; | 915 scoped_ptr<DateTimeChooserAndroid> date_time_chooser_; |
| 926 #endif | 916 #endif |
| 927 | 917 |
| 928 // Color chooser that was opened by this tab. | 918 // Color chooser that was opened by this tab. |
| 929 scoped_ptr<ColorChooser> color_chooser_; | 919 scoped_ptr<ColorChooser> color_chooser_; |
| 930 | 920 |
| 931 // A unique identifier for the current color chooser. Identifiers are unique | 921 // A unique identifier for the current color chooser. Identifiers are unique |
| (...skipping 30 matching lines...) Expand all Loading... |
| 962 // Maps the ids of pending image downloads to their callbacks | 952 // Maps the ids of pending image downloads to their callbacks |
| 963 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; | 953 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; |
| 964 ImageDownloadMap image_download_map_; | 954 ImageDownloadMap image_download_map_; |
| 965 | 955 |
| 966 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 956 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
| 967 }; | 957 }; |
| 968 | 958 |
| 969 } // namespace content | 959 } // namespace content |
| 970 | 960 |
| 971 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 961 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |