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 13 matching lines...) Expand all Loading... |
24 #include "chrome/common/instant_types.h" | 24 #include "chrome/common/instant_types.h" |
25 #include "chrome/common/translate_errors.h" | 25 #include "chrome/common/translate_errors.h" |
26 #include "chrome/common/web_apps.h" | 26 #include "chrome/common/web_apps.h" |
27 #include "content/browser/renderer_host/render_view_host_delegate.h" | 27 #include "content/browser/renderer_host/render_view_host_delegate.h" |
28 #include "content/browser/tab_contents/constrained_window.h" | 28 #include "content/browser/tab_contents/constrained_window.h" |
29 #include "content/browser/tab_contents/language_state.h" | 29 #include "content/browser/tab_contents/language_state.h" |
30 #include "content/browser/tab_contents/navigation_controller.h" | 30 #include "content/browser/tab_contents/navigation_controller.h" |
31 #include "content/browser/tab_contents/navigation_entry.h" | 31 #include "content/browser/tab_contents/navigation_entry.h" |
32 #include "content/browser/tab_contents/page_navigator.h" | 32 #include "content/browser/tab_contents/page_navigator.h" |
33 #include "content/browser/tab_contents/render_view_host_manager.h" | 33 #include "content/browser/tab_contents/render_view_host_manager.h" |
34 #include "content/browser/webui/web_ui_factory.h" | 34 #include "content/browser/webui/web_ui.h" |
35 #include "content/common/notification_registrar.h" | 35 #include "content/common/notification_registrar.h" |
36 #include "content/common/property_bag.h" | 36 #include "content/common/property_bag.h" |
37 #include "content/common/renderer_preferences.h" | 37 #include "content/common/renderer_preferences.h" |
38 #include "net/base/load_states.h" | 38 #include "net/base/load_states.h" |
39 #include "net/base/network_change_notifier.h" | 39 #include "net/base/network_change_notifier.h" |
40 #include "ui/gfx/native_widget_types.h" | 40 #include "ui/gfx/native_widget_types.h" |
41 | 41 |
42 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
43 #include "base/win/scoped_handle.h" | 43 #include "base/win/scoped_handle.h" |
44 #endif | 44 #endif |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 void SetAllContentsBlocked(bool value); | 598 void SetAllContentsBlocked(bool value); |
599 | 599 |
600 BlockedContentContainer* blocked_content_container() const { | 600 BlockedContentContainer* blocked_content_container() const { |
601 return blocked_contents_; | 601 return blocked_contents_; |
602 } | 602 } |
603 | 603 |
604 RendererPreferences* GetMutableRendererPrefs() { | 604 RendererPreferences* GetMutableRendererPrefs() { |
605 return &renderer_preferences_; | 605 return &renderer_preferences_; |
606 } | 606 } |
607 | 607 |
608 void set_opener_web_ui_type(WebUITypeID opener_web_ui_type) { | 608 void set_opener_web_ui_type(WebUI::WebUITypeID opener_web_ui_type) { |
609 opener_web_ui_type_ = opener_web_ui_type; | 609 opener_web_ui_type_ = opener_web_ui_type; |
610 } | 610 } |
611 | 611 |
612 // We want to time how long it takes to create a new tab page. This method | 612 // We want to time how long it takes to create a new tab page. This method |
613 // gets called as parts of the new tab page have loaded. | 613 // gets called as parts of the new tab page have loaded. |
614 void LogNewTabTime(const std::string& event_name); | 614 void LogNewTabTime(const std::string& event_name); |
615 | 615 |
616 // Set the time when we started to create the new tab page. This time is | 616 // Set the time when we started to create the new tab page. This time is |
617 // from before we created this TabContents. | 617 // from before we created this TabContents. |
618 void set_new_tab_start_time(const base::TimeTicks& time) { | 618 void set_new_tab_start_time(const base::TimeTicks& time) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 // Gets the minimum/maximum zoom percent. | 697 // Gets the minimum/maximum zoom percent. |
698 int minimum_zoom_percent() const { return minimum_zoom_percent_; } | 698 int minimum_zoom_percent() const { return minimum_zoom_percent_; } |
699 int maximum_zoom_percent() const { return maximum_zoom_percent_; } | 699 int maximum_zoom_percent() const { return maximum_zoom_percent_; } |
700 | 700 |
701 int content_restrictions() const { return content_restrictions_; } | 701 int content_restrictions() const { return content_restrictions_; } |
702 | 702 |
703 safe_browsing::ClientSideDetectionHost* safebrowsing_detection_host() { | 703 safe_browsing::ClientSideDetectionHost* safebrowsing_detection_host() { |
704 return safebrowsing_detection_host_.get(); | 704 return safebrowsing_detection_host_.get(); |
705 } | 705 } |
706 | 706 |
| 707 // Query the WebUIFactory for the WebUITypeID for the current URL. |
| 708 WebUI::WebUITypeID GetWebUITypeForCurrentState(); |
| 709 |
707 protected: | 710 protected: |
708 // from RenderViewHostDelegate. | 711 // from RenderViewHostDelegate. |
709 virtual bool OnMessageReceived(const IPC::Message& message); | 712 virtual bool OnMessageReceived(const IPC::Message& message); |
710 | 713 |
711 private: | 714 private: |
712 friend class NavigationController; | 715 friend class NavigationController; |
713 // Used to access the child_windows_ (ConstrainedWindowList) for testing | 716 // Used to access the child_windows_ (ConstrainedWindowList) for testing |
714 // automation purposes. | 717 // automation purposes. |
715 friend class TestingAutomationProvider; | 718 friend class TestingAutomationProvider; |
716 | 719 |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 | 1186 |
1184 // Shows an info-bar to users when they search from a known search engine and | 1187 // Shows an info-bar to users when they search from a known search engine and |
1185 // have never used the monibox for search before. | 1188 // have never used the monibox for search before. |
1186 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; | 1189 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; |
1187 | 1190 |
1188 // Settings that get passed to the renderer process. | 1191 // Settings that get passed to the renderer process. |
1189 RendererPreferences renderer_preferences_; | 1192 RendererPreferences renderer_preferences_; |
1190 | 1193 |
1191 // If this tab was created from a renderer using window.open, this will be | 1194 // If this tab was created from a renderer using window.open, this will be |
1192 // non-NULL and represent the WebUI of the opening renderer. | 1195 // non-NULL and represent the WebUI of the opening renderer. |
1193 WebUITypeID opener_web_ui_type_; | 1196 WebUI::WebUITypeID opener_web_ui_type_; |
1194 | 1197 |
1195 // The time that we started to create the new tab page. | 1198 // The time that we started to create the new tab page. |
1196 base::TimeTicks new_tab_start_time_; | 1199 base::TimeTicks new_tab_start_time_; |
1197 | 1200 |
1198 // The time that we started to close the tab. | 1201 // The time that we started to close the tab. |
1199 base::TimeTicks tab_close_start_time_; | 1202 base::TimeTicks tab_close_start_time_; |
1200 | 1203 |
1201 // The time that this tab was last selected. | 1204 // The time that this tab was last selected. |
1202 base::TimeTicks last_selected_time_; | 1205 base::TimeTicks last_selected_time_; |
1203 | 1206 |
(...skipping 15 matching lines...) Expand all Loading... |
1219 ObserverList<TabContentsObserver> observers_; | 1222 ObserverList<TabContentsObserver> observers_; |
1220 | 1223 |
1221 // Content restrictions, used to disable print/copy etc based on content's | 1224 // Content restrictions, used to disable print/copy etc based on content's |
1222 // (full-page plugins for now only) permissions. | 1225 // (full-page plugins for now only) permissions. |
1223 int content_restrictions_; | 1226 int content_restrictions_; |
1224 | 1227 |
1225 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1228 DISALLOW_COPY_AND_ASSIGN(TabContents); |
1226 }; | 1229 }; |
1227 | 1230 |
1228 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1231 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |