| 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 CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 6 #define CONTENT_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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 protected: | 497 protected: |
| 498 friend class TabContentsObserver; | 498 friend class TabContentsObserver; |
| 499 | 499 |
| 500 // Add and remove observers for page navigation notifications. Adding or | 500 // Add and remove observers for page navigation notifications. Adding or |
| 501 // removing multiple times has no effect. The order in which notifications | 501 // removing multiple times has no effect. The order in which notifications |
| 502 // are sent to observers is undefined. Clients must be sure to remove the | 502 // are sent to observers is undefined. Clients must be sure to remove the |
| 503 // observer before they go away. | 503 // observer before they go away. |
| 504 void AddObserver(TabContentsObserver* observer); | 504 void AddObserver(TabContentsObserver* observer); |
| 505 void RemoveObserver(TabContentsObserver* observer); | 505 void RemoveObserver(TabContentsObserver* observer); |
| 506 | 506 |
| 507 // From RenderViewHostDelegate. | |
| 508 virtual bool OnMessageReceived(const IPC::Message& message); | |
| 509 | |
| 510 private: | 507 private: |
| 511 friend class NavigationController; | 508 friend class NavigationController; |
| 512 // Used to access the child_windows_ (ConstrainedWindowList) for testing | 509 // Used to access the child_windows_ (ConstrainedWindowList) for testing |
| 513 // automation purposes. | 510 // automation purposes. |
| 514 friend class TestingAutomationProvider; | 511 friend class TestingAutomationProvider; |
| 515 | 512 |
| 516 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, NoJSMessageOnInterstitials); | 513 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, NoJSMessageOnInterstitials); |
| 517 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, UpdateTitle); | 514 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, UpdateTitle); |
| 518 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, CrossSiteCantPreemptAfterUnload); | 515 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, CrossSiteCantPreemptAfterUnload); |
| 519 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, ConstrainedWindows); | 516 FRIEND_TEST_ALL_PREFIXES(TabContentsTest, ConstrainedWindows); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 void OnDidRunInsecureContent(const std::string& security_origin, | 556 void OnDidRunInsecureContent(const std::string& security_origin, |
| 560 const GURL& target_url); | 557 const GURL& target_url); |
| 561 void OnDocumentLoadedInFrame(int64 frame_id); | 558 void OnDocumentLoadedInFrame(int64 frame_id); |
| 562 void OnDidFinishLoad(int64 frame_id); | 559 void OnDidFinishLoad(int64 frame_id); |
| 563 void OnUpdateContentRestrictions(int restrictions); | 560 void OnUpdateContentRestrictions(int restrictions); |
| 564 void OnGoToEntryAtOffset(int offset); | 561 void OnGoToEntryAtOffset(int offset); |
| 565 void OnUpdateZoomLimits(int minimum_percent, | 562 void OnUpdateZoomLimits(int minimum_percent, |
| 566 int maximum_percent, | 563 int maximum_percent, |
| 567 bool remember); | 564 bool remember); |
| 568 void OnFocusedNodeChanged(bool is_editable_node); | 565 void OnFocusedNodeChanged(bool is_editable_node); |
| 569 // Called when a file selection is to be done. | |
| 570 void OnRunFileChooser(const ViewHostMsg_RunFileChooser_Params& params); | |
| 571 void OnEnumerateDirectory(int request_id, const FilePath& path); | 566 void OnEnumerateDirectory(int request_id, const FilePath& path); |
| 572 | 567 |
| 573 // Changes the IsLoading state and notifies delegate as needed | 568 // Changes the IsLoading state and notifies delegate as needed |
| 574 // |details| is used to provide details on the load that just finished | 569 // |details| is used to provide details on the load that just finished |
| 575 // (but can be null if not applicable). Can be overridden. | 570 // (but can be null if not applicable). Can be overridden. |
| 576 void SetIsLoading(bool is_loading, | 571 void SetIsLoading(bool is_loading, |
| 577 LoadNotificationDetails* details); | 572 LoadNotificationDetails* details); |
| 578 | 573 |
| 579 // Called by derived classes to indicate that we're no longer waiting for a | 574 // Called by derived classes to indicate that we're no longer waiting for a |
| 580 // response. This won't actually update the throbber, but it will get picked | 575 // response. This won't actually update the throbber, but it will get picked |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 virtual void WorkerCrashed() OVERRIDE; | 697 virtual void WorkerCrashed() OVERRIDE; |
| 703 virtual void Activate() OVERRIDE; | 698 virtual void Activate() OVERRIDE; |
| 704 virtual void Deactivate() OVERRIDE; | 699 virtual void Deactivate() OVERRIDE; |
| 705 virtual void LostCapture() OVERRIDE; | 700 virtual void LostCapture() OVERRIDE; |
| 706 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 701 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 707 bool* is_keyboard_shortcut) OVERRIDE; | 702 bool* is_keyboard_shortcut) OVERRIDE; |
| 708 virtual void HandleKeyboardEvent( | 703 virtual void HandleKeyboardEvent( |
| 709 const NativeWebKeyboardEvent& event) OVERRIDE; | 704 const NativeWebKeyboardEvent& event) OVERRIDE; |
| 710 virtual void HandleMouseUp() OVERRIDE; | 705 virtual void HandleMouseUp() OVERRIDE; |
| 711 virtual void HandleMouseActivate() OVERRIDE; | 706 virtual void HandleMouseActivate() OVERRIDE; |
| 707 virtual bool OnMessageReceived(const IPC::Message& message); |
| 708 virtual void RunFileChooser(RenderViewHost* render_view_host, |
| 709 const ViewHostMsg_RunFileChooser_Params& params); |
| 712 | 710 |
| 713 // RenderViewHostManager::Delegate ------------------------------------------- | 711 // RenderViewHostManager::Delegate ------------------------------------------- |
| 714 | 712 |
| 715 // Blocks/unblocks interaction with renderer process. | 713 // Blocks/unblocks interaction with renderer process. |
| 716 void BlockTabContent(bool blocked); | 714 void BlockTabContent(bool blocked); |
| 717 | 715 |
| 718 virtual void BeforeUnloadFiredFromRenderManager( | 716 virtual void BeforeUnloadFiredFromRenderManager( |
| 719 bool proceed, | 717 bool proceed, |
| 720 bool* proceed_to_fire_unload); | 718 bool* proceed_to_fire_unload); |
| 721 virtual void DidStartLoadingFromRenderManager( | 719 virtual void DidStartLoadingFromRenderManager( |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 ObserverList<TabContentsObserver> observers_; | 865 ObserverList<TabContentsObserver> observers_; |
| 868 | 866 |
| 869 // Content restrictions, used to disable print/copy etc based on content's | 867 // Content restrictions, used to disable print/copy etc based on content's |
| 870 // (full-page plugins for now only) permissions. | 868 // (full-page plugins for now only) permissions. |
| 871 int content_restrictions_; | 869 int content_restrictions_; |
| 872 | 870 |
| 873 DISALLOW_COPY_AND_ASSIGN(TabContents); | 871 DISALLOW_COPY_AND_ASSIGN(TabContents); |
| 874 }; | 872 }; |
| 875 | 873 |
| 876 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 874 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
| OLD | NEW |