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 21 matching lines...) Expand all Loading... |
32 #include "ui/gfx/native_widget_types.h" | 32 #include "ui/gfx/native_widget_types.h" |
33 | 33 |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 #include "base/win/scoped_handle.h" | 35 #include "base/win/scoped_handle.h" |
36 #endif | 36 #endif |
37 | 37 |
38 namespace gfx { | 38 namespace gfx { |
39 class Rect; | 39 class Rect; |
40 } | 40 } |
41 | 41 |
42 namespace history { | |
43 class HistoryAddPageArgs; | |
44 } | |
45 | |
46 class Extension; | 42 class Extension; |
47 class LoadNotificationDetails; | 43 class LoadNotificationDetails; |
48 class Profile; | 44 class Profile; |
49 struct RendererPreferences; | 45 struct RendererPreferences; |
50 class RenderViewHost; | 46 class RenderViewHost; |
51 class SessionStorageNamespace; | 47 class SessionStorageNamespace; |
52 class SiteInstance; | 48 class SiteInstance; |
53 class SkBitmap; | 49 class SkBitmap; |
54 class TabContentsDelegate; | 50 class TabContentsDelegate; |
55 class TabContentsObserver; | 51 class TabContentsObserver; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 // The BookmarkDragDelegate is used to forward bookmark drag and drop events | 469 // The BookmarkDragDelegate is used to forward bookmark drag and drop events |
474 // to extensions. | 470 // to extensions. |
475 virtual RenderViewHostDelegate::BookmarkDrag* GetBookmarkDragDelegate(); | 471 virtual RenderViewHostDelegate::BookmarkDrag* GetBookmarkDragDelegate(); |
476 | 472 |
477 // It is up to callers to call SetBookmarkDragDelegate(NULL) when | 473 // It is up to callers to call SetBookmarkDragDelegate(NULL) when |
478 // |bookmark_drag| is deleted since this class does not take ownership of | 474 // |bookmark_drag| is deleted since this class does not take ownership of |
479 // |bookmark_drag|. | 475 // |bookmark_drag|. |
480 virtual void SetBookmarkDragDelegate( | 476 virtual void SetBookmarkDragDelegate( |
481 RenderViewHostDelegate::BookmarkDrag* bookmark_drag); | 477 RenderViewHostDelegate::BookmarkDrag* bookmark_drag); |
482 | 478 |
483 // Updates history with the specified navigation. This is called by | |
484 // OnMsgNavigate to update history state. | |
485 void UpdateHistoryForNavigation( | |
486 scoped_refptr<history::HistoryAddPageArgs> add_page_args); | |
487 | |
488 // Sends the page title to the history service. This is called when we receive | |
489 // the page title and we know we want to update history. | |
490 void UpdateHistoryPageTitle(const NavigationEntry& entry); | |
491 | |
492 // Gets the zoom level for this tab. | 479 // Gets the zoom level for this tab. |
493 double GetZoomLevel() const; | 480 double GetZoomLevel() const; |
494 | 481 |
495 // Gets the zoom percent for this tab. | 482 // Gets the zoom percent for this tab. |
496 int GetZoomPercent(bool* enable_increment, bool* enable_decrement); | 483 int GetZoomPercent(bool* enable_increment, bool* enable_decrement); |
497 | 484 |
498 // Opens view-source tab for this contents. | 485 // Opens view-source tab for this contents. |
499 void ViewSource(); | 486 void ViewSource(); |
500 | 487 |
501 void ViewFrameSource(const GURL& url, | 488 void ViewFrameSource(const GURL& url, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 #elif defined(TOOLKIT_USES_GTK) | 540 #elif defined(TOOLKIT_USES_GTK) |
554 friend class TabContentsViewGtk; | 541 friend class TabContentsViewGtk; |
555 #endif | 542 #endif |
556 | 543 |
557 // So InterstitialPage can access SetIsLoading. | 544 // So InterstitialPage can access SetIsLoading. |
558 friend class InterstitialPage; | 545 friend class InterstitialPage; |
559 | 546 |
560 // TODO(brettw) TestTabContents shouldn't exist! | 547 // TODO(brettw) TestTabContents shouldn't exist! |
561 friend class TestTabContents; | 548 friend class TestTabContents; |
562 | 549 |
563 // Used to access the CreateHistoryAddPageArgs member function. | |
564 friend class ExternalTabContainer; | |
565 | |
566 // Add all the TabContentObservers. | 550 // Add all the TabContentObservers. |
567 void AddObservers(); | 551 void AddObservers(); |
568 | 552 |
569 // Message handlers. | 553 // Message handlers. |
570 void OnDidStartProvisionalLoadForFrame(int64 frame_id, | 554 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
571 bool main_frame, | 555 bool main_frame, |
572 const GURL& url); | 556 const GURL& url); |
573 void OnDidRedirectProvisionalLoad(int32 page_id, | 557 void OnDidRedirectProvisionalLoad(int32 page_id, |
574 const GURL& source_url, | 558 const GURL& source_url, |
575 const GURL& target_url); | 559 const GURL& target_url); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 614 |
631 // Instruct the renderer to update the zoom level. | 615 // Instruct the renderer to update the zoom level. |
632 void UpdateZoomLevel(); | 616 void UpdateZoomLevel(); |
633 | 617 |
634 // If our controller was restored and the page id is > than the site | 618 // If our controller was restored and the page id is > than the site |
635 // instance's page id, the site instances page id is updated as well as the | 619 // instance's page id, the site instances page id is updated as well as the |
636 // renderers max page id. | 620 // renderers max page id. |
637 void UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, | 621 void UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, |
638 RenderViewHost* rvh); | 622 RenderViewHost* rvh); |
639 | 623 |
640 // Returns the history::HistoryAddPageArgs to use for adding a page to | |
641 // history. | |
642 scoped_refptr<history::HistoryAddPageArgs> CreateHistoryAddPageArgs( | |
643 const GURL& virtual_url, | |
644 const NavigationController::LoadCommittedDetails& details, | |
645 const ViewHostMsg_FrameNavigate_Params& params); | |
646 | |
647 // Saves the given title to the navigation entry and does associated work. It | 624 // Saves the given title to the navigation entry and does associated work. It |
648 // will update history and the view for the new title, and also synthesize | 625 // will update history and the view for the new title, and also synthesize |
649 // titles for file URLs that have none (so we require that the URL of the | 626 // titles for file URLs that have none (so we require that the URL of the |
650 // entry already be set). | 627 // entry already be set). |
651 // | 628 // |
652 // This is used as the backend for state updates, which include a new title, | 629 // This is used as the backend for state updates, which include a new title, |
653 // or the dedicated set title message. It returns true if the new title is | 630 // or the dedicated set title message. It returns true if the new title is |
654 // different and was therefore updated. | 631 // different and was therefore updated. |
655 bool UpdateTitleForEntry(NavigationEntry* entry, const std::wstring& title); | 632 bool UpdateTitleForEntry(NavigationEntry* entry, const std::wstring& title); |
656 | 633 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 // The current load state and the URL associated with it. | 810 // The current load state and the URL associated with it. |
834 net::LoadState load_state_; | 811 net::LoadState load_state_; |
835 string16 load_state_host_; | 812 string16 load_state_host_; |
836 // Upload progress, for displaying in the status bar. | 813 // Upload progress, for displaying in the status bar. |
837 // Set to zero when there is no significant upload happening. | 814 // Set to zero when there is no significant upload happening. |
838 uint64 upload_size_; | 815 uint64 upload_size_; |
839 uint64 upload_position_; | 816 uint64 upload_position_; |
840 | 817 |
841 // Data for current page ----------------------------------------------------- | 818 // Data for current page ----------------------------------------------------- |
842 | 819 |
843 // Whether we have a (non-empty) title for the current page. | |
844 // Used to prevent subsequent title updates from affecting history. This | |
845 // prevents some weirdness because some AJAXy apps use titles for status | |
846 // messages. | |
847 bool received_page_title_; | |
848 | |
849 // When a navigation occurs, we record its contents MIME type. It can be | 820 // When a navigation occurs, we record its contents MIME type. It can be |
850 // used to check whether we can do something for some special contents. | 821 // used to check whether we can do something for some special contents. |
851 std::string contents_mime_type_; | 822 std::string contents_mime_type_; |
852 | 823 |
853 // Character encoding. | 824 // Character encoding. |
854 std::string encoding_; | 825 std::string encoding_; |
855 | 826 |
856 // True if this is a secure page which displayed insecure content. | 827 // True if this is a secure page which displayed insecure content. |
857 bool displayed_insecure_content_; | 828 bool displayed_insecure_content_; |
858 | 829 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 ObserverList<TabContentsObserver> observers_; | 891 ObserverList<TabContentsObserver> observers_; |
921 | 892 |
922 // Content restrictions, used to disable print/copy etc based on content's | 893 // Content restrictions, used to disable print/copy etc based on content's |
923 // (full-page plugins for now only) permissions. | 894 // (full-page plugins for now only) permissions. |
924 int content_restrictions_; | 895 int content_restrictions_; |
925 | 896 |
926 DISALLOW_COPY_AND_ASSIGN(TabContents); | 897 DISALLOW_COPY_AND_ASSIGN(TabContents); |
927 }; | 898 }; |
928 | 899 |
929 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 900 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |