Chromium Code Reviews| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles); | 497 FRIEND_TEST_ALL_PREFIXES(FormStructureBrowserTest, HTMLFiles); |
| 498 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate); | 498 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, HistoryNavigate); |
| 499 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload); | 499 FRIEND_TEST_ALL_PREFIXES(RenderViewHostManagerTest, PageDoesBackAndReload); |
| 500 | 500 |
| 501 // So InterstitialPageImpl can access SetIsLoading. | 501 // So InterstitialPageImpl can access SetIsLoading. |
| 502 friend class InterstitialPageImpl; | 502 friend class InterstitialPageImpl; |
| 503 | 503 |
| 504 // TODO(brettw) TestWebContents shouldn't exist! | 504 // TODO(brettw) TestWebContents shouldn't exist! |
| 505 friend class TestWebContents; | 505 friend class TestWebContents; |
| 506 | 506 |
| 507 class DestructionObserver; | |
| 508 | |
| 507 // See WebContents::Create for a description of these parameters. | 509 // See WebContents::Create for a description of these parameters. |
| 508 WebContentsImpl(BrowserContext* browser_context, | 510 WebContentsImpl(BrowserContext* browser_context, |
| 509 WebContentsImpl* opener); | 511 WebContentsImpl* opener); |
| 510 | 512 |
| 511 // Add and remove observers for page navigation notifications. Adding or | 513 // Add and remove observers for page navigation notifications. Adding or |
| 512 // removing multiple times has no effect. The order in which notifications | 514 // removing multiple times has no effect. The order in which notifications |
| 513 // are sent to observers is undefined. Clients must be sure to remove the | 515 // are sent to observers is undefined. Clients must be sure to remove the |
| 514 // observer before they go away. | 516 // observer before they go away. |
| 515 void AddObserver(WebContentsObserver* observer); | 517 void AddObserver(WebContentsObserver* observer); |
| 516 void RemoveObserver(WebContentsObserver* observer); | 518 void RemoveObserver(WebContentsObserver* observer); |
| 517 | 519 |
| 518 // Clears this tab's opener if it has been closed. | 520 // Clears this tab's opener if it has been closed. |
| 519 void OnWebContentsDestroyed(WebContents* web_contents); | 521 void OnWebContentsDestroyed(WebContentsImpl* web_contents); |
| 522 | |
| 523 // Creats and adds to the map a destruction observer watching |web_contents|. | |
|
Avi (use Gerrit)
2013/05/15 19:22:20
typo
Paweł Hajdan Jr.
2013/05/21 18:59:15
Done.
| |
| 524 // No-op if such an observer already exists. | |
| 525 void AddDestructionObserver(WebContentsImpl* web_contents); | |
| 526 | |
| 527 // Deletes and removes from the map a destruction observer | |
| 528 // watching |web_contents|. No-op if there is no such observer. | |
| 529 void RemoveDestructionObserver(WebContentsImpl* web_contents); | |
| 520 | 530 |
| 521 // Callback function when showing JS dialogs. | 531 // Callback function when showing JS dialogs. |
| 522 void OnDialogClosed(RenderViewHost* rvh, | 532 void OnDialogClosed(RenderViewHost* rvh, |
| 523 IPC::Message* reply_msg, | 533 IPC::Message* reply_msg, |
| 524 bool success, | 534 bool success, |
| 525 const string16& user_input); | 535 const string16& user_input); |
| 526 | 536 |
| 527 // Callback function when requesting permission to access the PPAPI broker. | 537 // Callback function when requesting permission to access the PPAPI broker. |
| 528 // |result| is true if permission was granted. | 538 // |result| is true if permission was granted. |
| 529 void OnPpapiBrokerPermissionResult(int request_id, bool result); | 539 void OnPpapiBrokerPermissionResult(int request_id, bool result); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 731 // Tracks created WebContentsImpl objects that have not been shown yet. They | 741 // Tracks created WebContentsImpl objects that have not been shown yet. They |
| 732 // are identified by the route ID passed to CreateNewWindow. | 742 // are identified by the route ID passed to CreateNewWindow. |
| 733 typedef std::map<int, WebContentsImpl*> PendingContents; | 743 typedef std::map<int, WebContentsImpl*> PendingContents; |
| 734 PendingContents pending_contents_; | 744 PendingContents pending_contents_; |
| 735 | 745 |
| 736 // These maps hold on to the widgets that we created on behalf of the renderer | 746 // These maps hold on to the widgets that we created on behalf of the renderer |
| 737 // that haven't shown yet. | 747 // that haven't shown yet. |
| 738 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; | 748 typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews; |
| 739 PendingWidgetViews pending_widget_views_; | 749 PendingWidgetViews pending_widget_views_; |
| 740 | 750 |
| 751 typedef std::map<WebContentsImpl*, DestructionObserver*> DestructionObservers; | |
| 752 DestructionObservers destruction_observers_; | |
| 753 | |
| 741 // A list of observers notified when page state changes. Weak references. | 754 // A list of observers notified when page state changes. Weak references. |
| 742 // This MUST be listed above render_manager_ since at destruction time the | 755 // This MUST be listed above render_manager_ since at destruction time the |
| 743 // latter might cause RenderViewHost's destructor to call us and we might use | 756 // latter might cause RenderViewHost's destructor to call us and we might use |
| 744 // the observer list then. | 757 // the observer list then. |
| 745 ObserverList<WebContentsObserver> observers_; | 758 ObserverList<WebContentsObserver> observers_; |
| 746 | 759 |
| 747 // The tab that opened this tab, if any. Will be set to null if the opener | 760 // The tab that opened this tab, if any. Will be set to null if the opener |
| 748 // is closed. | 761 // is closed. |
| 749 WebContentsImpl* opener_; | 762 WebContentsImpl* opener_; |
| 750 | 763 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 910 // Maps the ids of pending image downloads to their callbacks | 923 // Maps the ids of pending image downloads to their callbacks |
| 911 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; | 924 typedef std::map<int, ImageDownloadCallback> ImageDownloadMap; |
| 912 ImageDownloadMap image_download_map_; | 925 ImageDownloadMap image_download_map_; |
| 913 | 926 |
| 914 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 927 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
| 915 }; | 928 }; |
| 916 | 929 |
| 917 } // namespace content | 930 } // namespace content |
| 918 | 931 |
| 919 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 932 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |