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.h" | 34 #include "content/browser/webui/web_ui_factory.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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 void SetAllContentsBlocked(bool value); | 593 void SetAllContentsBlocked(bool value); |
594 | 594 |
595 BlockedContentContainer* blocked_content_container() const { | 595 BlockedContentContainer* blocked_content_container() const { |
596 return blocked_contents_; | 596 return blocked_contents_; |
597 } | 597 } |
598 | 598 |
599 RendererPreferences* GetMutableRendererPrefs() { | 599 RendererPreferences* GetMutableRendererPrefs() { |
600 return &renderer_preferences_; | 600 return &renderer_preferences_; |
601 } | 601 } |
602 | 602 |
603 void set_opener_web_ui_type(WebUI::TypeID opener_web_ui_type) { | 603 void set_opener_web_ui_type(WebUITypeID opener_web_ui_type) { |
604 opener_web_ui_type_ = opener_web_ui_type; | 604 opener_web_ui_type_ = opener_web_ui_type; |
605 } | 605 } |
606 | 606 |
607 // We want to time how long it takes to create a new tab page. This method | 607 // We want to time how long it takes to create a new tab page. This method |
608 // gets called as parts of the new tab page have loaded. | 608 // gets called as parts of the new tab page have loaded. |
609 void LogNewTabTime(const std::string& event_name); | 609 void LogNewTabTime(const std::string& event_name); |
610 | 610 |
611 // Set the time when we started to create the new tab page. This time is | 611 // Set the time when we started to create the new tab page. This time is |
612 // from before we created this TabContents. | 612 // from before we created this TabContents. |
613 void set_new_tab_start_time(const base::TimeTicks& time) { | 613 void set_new_tab_start_time(const base::TimeTicks& time) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 int minimum_zoom_percent() const { return minimum_zoom_percent_; } | 686 int minimum_zoom_percent() const { return minimum_zoom_percent_; } |
687 int maximum_zoom_percent() const { return maximum_zoom_percent_; } | 687 int maximum_zoom_percent() const { return maximum_zoom_percent_; } |
688 | 688 |
689 int content_restrictions() const { return content_restrictions_; } | 689 int content_restrictions() const { return content_restrictions_; } |
690 void SetContentRestrictions(int restrictions); | 690 void SetContentRestrictions(int restrictions); |
691 | 691 |
692 safe_browsing::ClientSideDetectionHost* safebrowsing_detection_host() { | 692 safe_browsing::ClientSideDetectionHost* safebrowsing_detection_host() { |
693 return safebrowsing_detection_host_.get(); | 693 return safebrowsing_detection_host_.get(); |
694 } | 694 } |
695 | 695 |
696 // Query the WebUIFactory for the TypeID for the current URL. | |
697 WebUI::TypeID GetWebUITypeForCurrentState(); | |
698 | |
699 protected: | 696 protected: |
700 // from RenderViewHostDelegate. | 697 // from RenderViewHostDelegate. |
701 virtual bool OnMessageReceived(const IPC::Message& message); | 698 virtual bool OnMessageReceived(const IPC::Message& message); |
702 | 699 |
703 private: | 700 private: |
704 friend class NavigationController; | 701 friend class NavigationController; |
705 // Used to access the child_windows_ (ConstrainedWindowList) for testing | 702 // Used to access the child_windows_ (ConstrainedWindowList) for testing |
706 // automation purposes. | 703 // automation purposes. |
707 friend class TestingAutomationProvider; | 704 friend class TestingAutomationProvider; |
708 | 705 |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 | 1167 |
1171 // Shows an info-bar to users when they search from a known search engine and | 1168 // Shows an info-bar to users when they search from a known search engine and |
1172 // have never used the monibox for search before. | 1169 // have never used the monibox for search before. |
1173 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; | 1170 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; |
1174 | 1171 |
1175 // Settings that get passed to the renderer process. | 1172 // Settings that get passed to the renderer process. |
1176 RendererPreferences renderer_preferences_; | 1173 RendererPreferences renderer_preferences_; |
1177 | 1174 |
1178 // If this tab was created from a renderer using window.open, this will be | 1175 // If this tab was created from a renderer using window.open, this will be |
1179 // non-NULL and represent the WebUI of the opening renderer. | 1176 // non-NULL and represent the WebUI of the opening renderer. |
1180 WebUI::TypeID opener_web_ui_type_; | 1177 WebUITypeID opener_web_ui_type_; |
1181 | 1178 |
1182 // The time that we started to create the new tab page. | 1179 // The time that we started to create the new tab page. |
1183 base::TimeTicks new_tab_start_time_; | 1180 base::TimeTicks new_tab_start_time_; |
1184 | 1181 |
1185 // The time that we started to close the tab. | 1182 // The time that we started to close the tab. |
1186 base::TimeTicks tab_close_start_time_; | 1183 base::TimeTicks tab_close_start_time_; |
1187 | 1184 |
1188 // The time that this tab was last selected. | 1185 // The time that this tab was last selected. |
1189 base::TimeTicks last_selected_time_; | 1186 base::TimeTicks last_selected_time_; |
1190 | 1187 |
(...skipping 15 matching lines...) Expand all Loading... |
1206 ObserverList<TabContentsObserver> observers_; | 1203 ObserverList<TabContentsObserver> observers_; |
1207 | 1204 |
1208 // Content restrictions, used to disable print/copy etc based on content's | 1205 // Content restrictions, used to disable print/copy etc based on content's |
1209 // (full-page plugins for now only) permissions. | 1206 // (full-page plugins for now only) permissions. |
1210 int content_restrictions_; | 1207 int content_restrictions_; |
1211 | 1208 |
1212 DISALLOW_COPY_AND_ASSIGN(TabContents); | 1209 DISALLOW_COPY_AND_ASSIGN(TabContents); |
1213 }; | 1210 }; |
1214 | 1211 |
1215 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ | 1212 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ |
OLD | NEW |