summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/DEPS26
-rw-r--r--content/browser/browser_child_process_host.cc1
-rw-r--r--content/browser/clipboard_dispatcher.h41
-rw-r--r--content/browser/clipboard_dispatcher_gtk.cc33
-rw-r--r--content/browser/clipboard_dispatcher_mac.mm34
-rw-r--r--content/browser/clipboard_dispatcher_win.cc33
-rw-r--r--content/browser/content_browser_client.cc9
-rw-r--r--content/browser/content_browser_client.h10
-rw-r--r--content/browser/renderer_host/clipboard_message_filter.cc2
-rw-r--r--content/browser/renderer_host/render_view_host.h1
-rw-r--r--content/browser/renderer_host/render_view_host_delegate.h1
-rw-r--r--content/browser/tab_contents/background_contents.h185
-rw-r--r--content/browser/tab_contents/interstitial_page.cc1
-rw-r--r--content/browser/tab_contents/tab_contents.cc62
-rw-r--r--content/browser/tab_contents/tab_contents.h11
-rw-r--r--content/common/content_restriction.h19
-rw-r--r--content/content_browser.gypi4
-rw-r--r--content/content_common.gypi1
18 files changed, 190 insertions, 284 deletions
diff --git a/content/browser/DEPS b/content/browser/DEPS
index eb3b4a8..3916230 100644
--- a/content/browser/DEPS
+++ b/content/browser/DEPS
@@ -4,9 +4,6 @@ include_rules = [
# Listing of the remaining #chrome includes in content\browser. People are
# actively working on reducing this to 0. Do not add anymore!
- # jam will move asap, this was forgotten
- "+chrome/browser/renderer_host/render_view_host_delegate.h",
-
# http://crbug.com/77093
"+chrome/app/breakpad_mac.h",
"+chrome/browser/crash_handler_host_linux.h",
@@ -16,8 +13,6 @@ include_rules = [
"+chrome/browser/automation/automation_resource_message_filter.h",
"+chrome/browser/automation/automation_resource_routing_delegate.h",
- "+chrome/browser/clipboard_dispatcher.h",
-
"+chrome/browser/browser_about_handler.h",
"+chrome/browser/browser_process.h",
@@ -26,8 +21,6 @@ include_rules = [
"+chrome/browser/browser_url_handler.h",
- "+chrome/browser/character_encoding.h",
-
# http://crbug.com/76793
"+chrome/browser/content_settings/content_settings_details.h",
"+chrome/browser/content_settings/host_content_settings_map.h",
@@ -44,8 +37,6 @@ include_rules = [
"+chrome/browser/defaults.h",
- "+chrome/browser/dom_operation_notification_details.h",
-
"+chrome/browser/download/download_file_manager.h",
"+chrome/browser/download/download_item_model.h",
"+chrome/browser/download/download_manager.h",
@@ -66,8 +57,6 @@ include_rules = [
"+chrome/browser/favicon/favicon_tab_helper.h",
"+chrome/browser/favicon/favicon_service.h",
- "+chrome/browser/google/google_util.h",
-
# http://crbug.com/76794
"+chrome/browser/history/history.h",
"+chrome/browser/history/history_types.h",
@@ -79,8 +68,6 @@ include_rules = [
"+chrome/browser/mach_broker_mac.h",
- "+chrome/browser/metrics/metric_event_duration_details.h",
-
"+chrome/browser/net/load_timing_observer.h",
"+chrome/browser/net/predictor_api.h",
"+chrome/browser/net/resolve_proxy_msg_helper.h",
@@ -90,10 +77,6 @@ include_rules = [
"+chrome/browser/notifications/desktop_notification_service_factory.h",
"+chrome/browser/notifications/notifications_prefs_cache.h",
- "+chrome/browser/omnibox_search_hint.h",
-
- "+chrome/browser/pdf_unsupported_feature.h",
-
"+chrome/browser/platform_util.h",
"+chrome/browser/plugin_download_helper.h",
@@ -164,8 +147,6 @@ include_rules = [
"+chrome/common/render_messages.h",
"+chrome/common/url_constants.h",
- "+chrome/common/content_restriction.h",
-
"+chrome/common/icon_messages.h",
# http://crbug.com/77091
@@ -179,17 +160,10 @@ include_rules = [
"+chrome/common/security_style.h",
- # http://crbug.com/77088
- "+chrome/common/translate_errors.h",
-
"+chrome/common/view_types.h",
- "+chrome/common/window_container_type.h",
-
"+chrome/common/net/x509_certificate_model.h",
- "+chrome/installer/util/google_update_settings.h",
-
# ONLY USED BY TESTS
"+chrome/browser/chromeos/cros/mock_network_library.h",
"+chrome/browser/net/url_request_failed_dns_job.h",
diff --git a/content/browser/browser_child_process_host.cc b/content/browser/browser_child_process_host.cc
index 43759e1..e6375f0 100644
--- a/content/browser/browser_child_process_host.cc
+++ b/content/browser/browser_child_process_host.cc
@@ -18,7 +18,6 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/installer/util/google_update_settings.h"
#include "content/browser/browser_thread.h"
#include "content/browser/renderer_host/resource_message_filter.h"
#include "content/browser/trace_message_filter.h"
diff --git a/content/browser/clipboard_dispatcher.h b/content/browser/clipboard_dispatcher.h
new file mode 100644
index 0000000..7b62d0c
--- /dev/null
+++ b/content/browser/clipboard_dispatcher.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_CLIPBOARD_DISPATCHER_H_
+#define CONTENT_BROWSER_CLIPBOARD_DISPATCHER_H_
+#pragma once
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "ui/base/clipboard/clipboard.h"
+
+// This class backs IPC requests from the renderer for clipboard data. In this
+// context, clipboard does not only refer to the usual concept of a clipboard
+// for copy/paste, which is why it's not in app/clipboard/clipboard.h. It can
+// refer to one of three different types of clipboards:
+// - The copy/paste clipboard, which contains data that has been copied/cut.
+// - The dragging clipboard, which contains data that is currently being
+// dragged.
+// - On X, the selection clipboard, which contains data for the current
+// selection.
+class ClipboardDispatcher {
+ public:
+ static bool ReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames);
+ static bool ReadData(ui::Clipboard::Buffer buffer, const string16& type,
+ string16* data, string16* metadata);
+ static bool ReadFilenames(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* filenames);
+
+ private:
+ // This class is not meant to be instantiated. All public members are static.
+ ClipboardDispatcher();
+
+ DISALLOW_COPY_AND_ASSIGN(ClipboardDispatcher);
+};
+
+#endif // CONTENT_BROWSER_CLIPBOARD_DISPATCHER_H_
diff --git a/content/browser/clipboard_dispatcher_gtk.cc b/content/browser/clipboard_dispatcher_gtk.cc
new file mode 100644
index 0000000..88b57fe
--- /dev/null
+++ b/content/browser/clipboard_dispatcher_gtk.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/clipboard_dispatcher.h"
+
+#include "base/logging.h"
+
+bool ClipboardDispatcher::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) {
+ DCHECK(types);
+ DCHECK(contains_filenames);
+ types->clear();
+ *contains_filenames = false;
+ return false;
+}
+
+bool ClipboardDispatcher::ReadData(ui::Clipboard::Buffer buffer,
+ const string16& type,
+ string16* data,
+ string16* metadata) {
+ DCHECK(data);
+ DCHECK(metadata);
+ return false;
+}
+
+bool ClipboardDispatcher::ReadFilenames(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* filenames) {
+ DCHECK(filenames);
+ filenames->clear();
+ return false;
+}
diff --git a/content/browser/clipboard_dispatcher_mac.mm b/content/browser/clipboard_dispatcher_mac.mm
new file mode 100644
index 0000000..cfc4f93
--- /dev/null
+++ b/content/browser/clipboard_dispatcher_mac.mm
@@ -0,0 +1,34 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/clipboard_dispatcher.h"
+
+#include "base/logging.h"
+
+bool ClipboardDispatcher::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) {
+ DCHECK(types);
+ DCHECK(contains_filenames);
+ types->clear();
+ *contains_filenames = false;
+ return false;
+}
+
+bool ClipboardDispatcher::ReadData(ui::Clipboard::Buffer buffer,
+ const string16& type,
+ string16* data,
+ string16* metadata) {
+ DCHECK(data);
+ DCHECK(metadata);
+ return false;
+}
+
+bool ClipboardDispatcher::ReadFilenames(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* filenames) {
+ DCHECK(filenames);
+ filenames->clear();
+ return false;
+}
+
diff --git a/content/browser/clipboard_dispatcher_win.cc b/content/browser/clipboard_dispatcher_win.cc
new file mode 100644
index 0000000..88b57fe
--- /dev/null
+++ b/content/browser/clipboard_dispatcher_win.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/clipboard_dispatcher.h"
+
+#include "base/logging.h"
+
+bool ClipboardDispatcher::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) {
+ DCHECK(types);
+ DCHECK(contains_filenames);
+ types->clear();
+ *contains_filenames = false;
+ return false;
+}
+
+bool ClipboardDispatcher::ReadData(ui::Clipboard::Buffer buffer,
+ const string16& type,
+ string16* data,
+ string16* metadata) {
+ DCHECK(data);
+ DCHECK(metadata);
+ return false;
+}
+
+bool ClipboardDispatcher::ReadFilenames(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* filenames) {
+ DCHECK(filenames);
+ filenames->clear();
+ return false;
+}
diff --git a/content/browser/content_browser_client.cc b/content/browser/content_browser_client.cc
index c02c95c..c444733 100644
--- a/content/browser/content_browser_client.cc
+++ b/content/browser/content_browser_client.cc
@@ -31,4 +31,13 @@ GURL ContentBrowserClient::GetEffectiveURL(Profile* profile, const GURL& url) {
return url;
}
+GURL ContentBrowserClient::GetAlternateErrorPageURL(const TabContents* tab) {
+ return GURL();
+}
+
+std::string ContentBrowserClient::GetCanonicalEncodingNameByAliasName(
+ const std::string& alias_name) {
+ return alias_name;
+}
+
} // namespace content
diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h
index bcb2d15..49a2bbf 100644
--- a/content/browser/content_browser_client.h
+++ b/content/browser/content_browser_client.h
@@ -6,12 +6,15 @@
#define CONTENT_BROWSER_CONTENT_BROWSER_CLIENT_H_
#pragma once
+#include <string>
+
#include "content/common/content_client.h"
class BrowserRenderProcessHost;
class GURL;
class Profile;
class RenderViewHost;
+class TabContents;
namespace content {
@@ -37,6 +40,13 @@ class ContentBrowserClient {
// Get the effective URL for the given actual URL, to allow an embedder to
// group different url schemes in the same SiteInstance.
virtual GURL GetEffectiveURL(Profile* profile, const GURL& url);
+
+ // See RenderViewHostDelegate's comment.
+ virtual GURL GetAlternateErrorPageURL(const TabContents* tab);
+
+ // See CharacterEncoding's comment.
+ virtual std::string GetCanonicalEncodingNameByAliasName(
+ const std::string& alias_name);
};
} // namespace content
diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc
index c69691a..b1656b0 100644
--- a/content/browser/renderer_host/clipboard_message_filter.cc
+++ b/content/browser/renderer_host/clipboard_message_filter.cc
@@ -12,7 +12,7 @@
#include "base/stl_util-inl.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/clipboard_dispatcher.h"
+#include "content/browser/clipboard_dispatcher.h"
#include "content/common/clipboard_messages.h"
#include "googleurl/src/gurl.h"
#include "ipc/ipc_message_macros.h"
diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h
index 904fe4c..14ecddd 100644
--- a/content/browser/renderer_host/render_view_host.h
+++ b/content/browser/renderer_host/render_view_host.h
@@ -15,7 +15,6 @@
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/render_view_commands.h"
-#include "chrome/common/translate_errors.h"
#include "chrome/common/view_types.h"
#include "content/browser/renderer_host/render_widget_host.h"
#include "content/common/page_zoom.h"
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index dc9d120..be5d687 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -14,7 +14,6 @@
#include "base/process_util.h"
#include "base/string16.h"
#include "chrome/common/content_settings_types.h"
-#include "chrome/common/translate_errors.h"
#include "chrome/common/view_types.h"
#include "content/common/dom_storage_common.h"
#include "content/common/window_container_type.h"
diff --git a/content/browser/tab_contents/background_contents.h b/content/browser/tab_contents/background_contents.h
deleted file mode 100644
index ef03cd4..0000000
--- a/content/browser/tab_contents/background_contents.h
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_
-#define CONTENT_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_
-#pragma once
-
-#include <string>
-#include <vector>
-
-#include "chrome/browser/renderer_host/render_view_host_delegate.h"
-#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
-#include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h"
-#include "chrome/common/view_types.h"
-#include "chrome/common/window_container_type.h"
-#include "content/common/notification_registrar.h"
-#include "webkit/glue/window_open_disposition.h"
-
-class TabContents;
-struct WebPreferences;
-class DesktopNotificationHandler;
-
-namespace gfx {
-class Rect;
-}
-
-// This class is a peer of TabContents. It can host a renderer, but does not
-// have any visible display. Its navigation is not managed by a
-// NavigationController because is has no facility for navigating (other than
-// programatically view window.location.href) or RenderViewHostManager because
-// it is never allowed to navigate across a SiteInstance boundary.
-class BackgroundContents : public RenderViewHostDelegate,
- public RenderViewHostDelegate::View,
- public NotificationObserver,
- public JavaScriptAppModalDialogDelegate {
- public:
- class Delegate {
- public:
- // Called by ShowCreatedWindow. Asks the delegate to attach the opened
- // TabContents to a suitable container (e.g. browser) or to show it if it's
- // a popup window.
- virtual void AddTabContents(TabContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture) = 0;
-
- protected:
- virtual ~Delegate() {}
- };
-
- BackgroundContents(SiteInstance* site_instance,
- int routing_id,
- Delegate* delegate);
- virtual ~BackgroundContents();
-
- // Provide access to the RenderViewHost for the
- // RenderViewHostDelegateViewHelper
- RenderViewHost* render_view_host() { return render_view_host_; }
-
- // RenderViewHostDelegate implementation.
- virtual BackgroundContents* GetAsBackgroundContents();
- virtual RenderViewHostDelegate::View* GetViewDelegate();
- virtual const GURL& GetURL() const;
- virtual ViewType::Type GetRenderViewType() const;
- virtual int GetBrowserWindowID() const;
- virtual void DidNavigate(RenderViewHost* render_view_host,
- const ViewHostMsg_FrameNavigate_Params& params);
- virtual WebPreferences GetWebkitPrefs();
- virtual void RunJavaScriptMessage(const std::wstring& message,
- const std::wstring& default_prompt,
- const GURL& frame_url,
- const int flags,
- IPC::Message* reply_msg,
- bool* did_suppress_message);
- virtual void Close(RenderViewHost* render_view_host);
- virtual RendererPreferences GetRendererPrefs(Profile* profile) const;
- virtual void RenderViewGone(RenderViewHost* rvh,
- base::TerminationStatus status,
- int error_code);
- virtual bool OnMessageReceived(const IPC::Message& message);
-
- // RenderViewHostDelegate::View
- virtual void CreateNewWindow(
- int route_id,
- const ViewHostMsg_CreateWindow_Params& params);
- virtual void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type);
- virtual void CreateNewFullscreenWidget(int route_id);
- virtual void ShowCreatedWindow(int route_id,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture);
- virtual void ShowCreatedWidget(int route_id,
- const gfx::Rect& initial_pos);
- virtual void ShowCreatedFullscreenWidget(int route_id);
- virtual void ShowContextMenu(const ContextMenuParams& params) {}
- virtual void ShowPopupMenu(const gfx::Rect& bounds,
- int item_height,
- double item_font_size,
- int selected_item,
- const std::vector<WebMenuItem>& items,
- bool right_aligned) {}
- virtual void StartDragging(const WebDropData& drop_data,
- WebKit::WebDragOperationsMask allowed_operations,
- const SkBitmap& image,
- const gfx::Point& image_offset) {}
- virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {}
- virtual void GotFocus() {}
- virtual void TakeFocus(bool reverse) {}
- virtual void LostCapture() {}
- virtual void Activate() {}
- virtual void Deactivate() {}
- virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
- bool* is_keyboard_shortcut);
- virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {}
- virtual void HandleMouseMove() {}
- virtual void HandleMouseDown() {}
- virtual void HandleMouseLeave() {}
- virtual void HandleMouseUp() {}
- virtual void HandleMouseActivate() {}
- virtual void UpdatePreferredSize(const gfx::Size& new_size) {}
-
- // NotificationObserver
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
-
- // Overridden from JavaScriptAppModalDialogDelegate:
- virtual void OnMessageBoxClosed(IPC::Message* reply_msg,
- bool success,
- const std::wstring& prompt);
- virtual void SetSuppressMessageBoxes(bool suppress_message_boxes) {}
- virtual gfx::NativeWindow GetMessageBoxRootWindow();
- virtual TabContents* AsTabContents();
- virtual ExtensionHost* AsExtensionHost();
-
- virtual void UpdateInspectorSetting(const std::string& key,
- const std::string& value);
- virtual void ClearInspectorSettings();
-
- // Helper to find the BackgroundContents that originated the given request.
- // Can be NULL if the page has been closed or some other error occurs.
- // Should only be called from the UI thread, since it accesses
- // BackgroundContents.
- static BackgroundContents* GetBackgroundContentsByID(int render_process_id,
- int render_view_id);
-
- protected:
- // Exposed for testing.
- BackgroundContents();
-
- private:
- // The delegate for this BackgroundContents.
- Delegate* delegate_;
-
- // The host for our HTML content.
- RenderViewHost* render_view_host_;
-
- // Common implementations of some RenderViewHostDelegate::View methods.
- RenderViewHostDelegateViewHelper delegate_view_helper_;
-
- // The URL being hosted.
- GURL url_;
-
- NotificationRegistrar registrar_;
-
- // Handles desktop notification IPCs.
- scoped_ptr<DesktopNotificationHandler> desktop_notification_handler_;
-
- DISALLOW_COPY_AND_ASSIGN(BackgroundContents);
-};
-
-// This is the data sent out as the details with BACKGROUND_CONTENTS_OPENED.
-struct BackgroundContentsOpenedDetails {
- // The BackgroundContents object that has just been opened.
- BackgroundContents* contents;
-
- // The name of the parent frame for these contents.
- const string16& frame_name;
-
- // The ID of the parent application (if any).
- const string16& application_id;
-};
-
-#endif // CONTENT_BROWSER_TAB_CONTENTS_BACKGROUND_CONTENTS_H_
diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc
index da0b968..c764621 100644
--- a/content/browser/tab_contents/interstitial_page.cc
+++ b/content/browser/tab_contents/interstitial_page.cc
@@ -12,7 +12,6 @@
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/ui/browser_list.h"
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 00a58c3..ebb7461 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -15,27 +15,21 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
-#include "chrome/browser/character_encoding.h"
#include "chrome/browser/content_settings/content_settings_details.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/defaults.h"
-#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/external_protocol_handler.h"
#include "chrome/browser/favicon/favicon_service.h"
-#include "chrome/browser/google/google_util.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/load_from_memory_cache_details.h"
#include "chrome/browser/load_notification_details.h"
-#include "chrome/browser/metrics/metric_event_duration_details.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
-#include "chrome/browser/omnibox_search_hint.h"
-#include "chrome/browser/pdf_unsupported_feature.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/plugin_observer.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -50,7 +44,6 @@
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/content_restriction.h"
#include "chrome/common/icon_messages.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
@@ -74,6 +67,7 @@
#include "content/browser/webui/web_ui_factory.h"
#include "content/common/bindings_policy.h"
#include "content/common/content_client.h"
+#include "content/common/content_restriction.h"
#include "content/common/navigation_types.h"
#include "content/common/notification_service.h"
#include "content/common/view_messages.h"
@@ -289,10 +283,6 @@ TabContents::TabContents(Profile* profile,
registrar_.Add(this, NotificationType::GOOGLE_URL_UPDATED,
NotificationService::AllSources());
- // Set-up the showing of the omnibox search infobar if applicable.
- if (OmniboxSearchHint::IsEnabled(profile))
- omnibox_search_hint_.reset(new OmniboxSearchHint(this));
-
// Can only add observers after render_manager_.Init() is called, since that's
// what sets up the render_view_host which TabContentObserver's constructor
// uses to get the routing_id.
@@ -394,8 +384,6 @@ bool TabContents::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions,
OnUpdateContentRestrictions)
- IPC_MESSAGE_HANDLER(ViewHostMsg_PDFHasUnsupportedFeature,
- OnPDFHasUnsupportedFeature)
IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
@@ -1014,33 +1002,6 @@ void TabContents::WindowMoveOrResizeStarted() {
render_view_host()->WindowMoveOrResizeStarted();
}
-void TabContents::LogNewTabTime(const std::string& event_name) {
- // Not all new tab pages get timed. In those cases, we don't have a
- // new_tab_start_time_.
- if (new_tab_start_time_.is_null())
- return;
-
- base::TimeDelta duration = base::TimeTicks::Now() - new_tab_start_time_;
- MetricEventDurationDetails details(event_name,
- static_cast<int>(duration.InMilliseconds()));
-
- if (event_name == "Tab.NewTabScriptStart") {
- UMA_HISTOGRAM_TIMES("Tab.NewTabScriptStart", duration);
- } else if (event_name == "Tab.NewTabDOMContentLoaded") {
- UMA_HISTOGRAM_TIMES("Tab.NewTabDOMContentLoaded", duration);
- } else if (event_name == "Tab.NewTabOnload") {
- UMA_HISTOGRAM_TIMES("Tab.NewTabOnload", duration);
- // The new tab page has finished loading; reset it.
- new_tab_start_time_ = base::TimeTicks();
- } else {
- NOTREACHED();
- }
- NotificationService::current()->Notify(
- NotificationType::METRIC_EVENT_DURATION,
- Source<TabContents>(this),
- Details<MetricEventDurationDetails>(&details));
-}
-
void TabContents::OnCloseStarted() {
if (tab_close_start_time_.is_null())
tab_close_start_time_ = base::TimeTicks::Now();
@@ -1297,10 +1258,6 @@ void TabContents::OnUpdateContentRestrictions(int restrictions) {
SetContentRestrictions(restrictions);
}
-void TabContents::OnPDFHasUnsupportedFeature() {
- PDFHasUnsupportedFeature(this);
-}
-
// Notifies the RenderWidgetHost instance about the fact that the page is
// loading, or done loading and calls the base implementation.
void TabContents::SetIsLoading(bool is_loading,
@@ -2076,19 +2033,7 @@ void TabContents::RunBeforeUnloadConfirm(const std::wstring& message,
}
GURL TabContents::GetAlternateErrorPageURL() const {
- GURL url;
- // Disable alternate error pages when in OffTheRecord/Incognito mode.
- if (profile()->IsOffTheRecord())
- return url;
-
- PrefService* prefs = profile()->GetPrefs();
- DCHECK(prefs);
- if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) {
- url = google_util::AppendGoogleLocaleParam(
- GURL(google_util::kLinkDoctorBaseURL));
- url = google_util::AppendGoogleTLDParam(url);
- }
- return url;
+ return content::GetContentClient()->browser()->GetAlternateErrorPageURL(this);
}
WebPreferences TabContents::GetWebkitPrefs() {
@@ -2392,7 +2337,8 @@ ExtensionHost* TabContents::AsExtensionHost() {
}
void TabContents::set_encoding(const std::string& encoding) {
- encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding);
+ encoding_ = content::GetContentClient()->browser()->
+ GetCanonicalEncodingNameByAliasName(encoding);
}
void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) {
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 5fe5e97..3eb3012 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -60,7 +60,6 @@ class DownloadItem;
class Extension;
class InfoBarDelegate;
class LoadNotificationDetails;
-class OmniboxSearchHint;
class PluginObserver;
class Profile;
class RenderViewHost;
@@ -503,15 +502,12 @@ class TabContents : public PageNavigator,
opener_web_ui_type_ = opener_web_ui_type;
}
- // We want to time how long it takes to create a new tab page. This method
- // gets called as parts of the new tab page have loaded.
- void LogNewTabTime(const std::string& event_name);
-
// Set the time when we started to create the new tab page. This time is
// from before we created this TabContents.
void set_new_tab_start_time(const base::TimeTicks& time) {
new_tab_start_time_ = time;
}
+ base::TimeTicks new_tab_start_time() const { return new_tab_start_time_; }
// Notification that tab closing has started. This can be called multiple
// times, subsequent calls are ignored.
@@ -667,7 +663,6 @@ class TabContents : public PageNavigator,
void OnDocumentLoadedInFrame(int64 frame_id);
void OnDidFinishLoad(int64 frame_id);
void OnUpdateContentRestrictions(int restrictions);
- void OnPDFHasUnsupportedFeature();
void OnGoToEntryAtOffset(int offset);
@@ -1013,10 +1008,6 @@ class TabContents : public PageNavigator,
// turn it off in OnJavaScriptMessageBoxClosed if the navigation is canceled.
bool is_showing_before_unload_dialog_;
- // Shows an info-bar to users when they search from a known search engine and
- // have never used the monibox for search before.
- scoped_ptr<OmniboxSearchHint> omnibox_search_hint_;
-
// Settings that get passed to the renderer process.
RendererPreferences renderer_preferences_;
diff --git a/content/common/content_restriction.h b/content/common/content_restriction.h
new file mode 100644
index 0000000..1497939
--- /dev/null
+++ b/content/common/content_restriction.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_CONTENT_RESTRICTION_H_
+#define CONTENT_COMMON_CONTENT_RESTRICTION_H_
+#pragma once
+
+// Used by a full-page plugin to disable browser commands because of
+// restrictions on how the data is to be used (i.e. can't copy/print).
+enum ContentRestriction {
+ CONTENT_RESTRICTION_COPY = 1 << 0,
+ CONTENT_RESTRICTION_CUT = 1 << 1,
+ CONTENT_RESTRICTION_PASTE = 1 << 2,
+ CONTENT_RESTRICTION_PRINT = 1 << 3,
+ CONTENT_RESTRICTION_SAVE = 1 << 4
+};
+
+#endif // CONTENT_COMMON_CONTENT_RESTRICTION_H_
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index 53129ff..7738ccc 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -52,6 +52,10 @@
'browser/child_process_security_policy.h',
'browser/chrome_blob_storage_context.cc',
'browser/chrome_blob_storage_context.h',
+ 'browser/clipboard_dispatcher.h',
+ 'browser/clipboard_dispatcher_gtk.cc',
+ 'browser/clipboard_dispatcher_mac.mm',
+ 'browser/clipboard_dispatcher_win.cc',
'browser/content_browser_client.cc',
'browser/content_browser_client.h',
'browser/cross_site_request_manager.cc',
diff --git a/content/content_common.gypi b/content/content_common.gypi
index b2e442e..998641c 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -62,6 +62,7 @@
'common/content_counters.h',
'common/content_paths.cc',
'common/content_paths.h',
+ 'common/content_restriction.h',
'common/content_switches.cc',
'common/content_switches.h',
'common/css_colors.h',