summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
Diffstat (limited to 'content/common')
-rw-r--r--content/common/bindings_policy.h43
-rw-r--r--content/common/content_constants.cc2
-rw-r--r--content/common/content_constants.h7
-rw-r--r--content/common/content_switches.cc22
-rw-r--r--content/common/content_switches.h6
-rw-r--r--content/common/url_constants.cc34
-rw-r--r--content/common/url_constants.h49
-rw-r--r--content/common/view_messages.h55
8 files changed, 218 insertions, 0 deletions
diff --git a/content/common/bindings_policy.h b/content/common/bindings_policy.h
new file mode 100644
index 0000000..2dcea30
--- /dev/null
+++ b/content/common/bindings_policy.h
@@ -0,0 +1,43 @@
+// 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_COMMON_BINDINGS_POLICY_H_
+#define CONTENT_COMMON_BINDINGS_POLICY_H_
+#pragma once
+
+// This is a utility class that specifies flag values for the types of
+// JavaScript bindings exposed to renderers.
+class BindingsPolicy {
+ public:
+ enum {
+ // HTML-based UI bindings that allows he js content to send JSON-encoded
+ // data back to the browser process.
+ WEB_UI = 1 << 0,
+ // DOM automation bindings that allows the js content to send JSON-encoded
+ // data back to automation in the parent process. (By default this isn't
+ // allowed unless the app has been started up with the --dom-automation
+ // switch.)
+ DOM_AUTOMATION = 1 << 1,
+ // Bindings that allow access to the external host (through automation).
+ EXTERNAL_HOST = 1 << 2,
+ // Special bindings with privileged APIs for code running in the extension
+ // process.
+ EXTENSION = 1 << 3,
+ };
+
+ static bool is_web_ui_enabled(int flags) {
+ return (flags & WEB_UI) != 0;
+ }
+ static bool is_dom_automation_enabled(int flags) {
+ return (flags & DOM_AUTOMATION) != 0;
+ }
+ static bool is_external_host_enabled(int flags) {
+ return (flags & EXTERNAL_HOST) != 0;
+ }
+ static bool is_extension_enabled(int flags) {
+ return (flags & EXTENSION) != 0;
+ }
+};
+
+#endif // CONTENT_COMMON_BINDINGS_POLICY_H_
diff --git a/content/common/content_constants.cc b/content/common/content_constants.cc
index 2532fc1..3ecda57 100644
--- a/content/common/content_constants.cc
+++ b/content/common/content_constants.cc
@@ -6,6 +6,8 @@
namespace content {
+const int kMaxSessionHistoryEntries = 50;
+const size_t kMaxTitleChars = 4 * 1024;
const size_t kMaxURLChars = 2 * 1024 * 1024;
const size_t kMaxURLDisplayChars = 32 * 1024;
diff --git a/content/common/content_constants.h b/content/common/content_constants.h
index ca94329..05739ff 100644
--- a/content/common/content_constants.h
+++ b/content/common/content_constants.h
@@ -12,6 +12,13 @@
namespace content {
+// The maximum number of session history entries per tab.
+extern const int kMaxSessionHistoryEntries;
+
+// The maximum number of characters of the document's title that we're willing
+// to accept in the browser process.
+extern const size_t kMaxTitleChars;
+
// The maximum number of characters in the URL that we're willing to accept
// in the browser process. It is set low enough to avoid damage to the browser
// but high enough that a web site can abuse location.hash for a little storage.
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index a03233d..9e64cb7 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -27,6 +27,10 @@ const char kDisableAcceleratedCompositing[] = "disable-accelerated-compositing";
// Disable the ApplicationCache.
const char kDisableApplicationCache[] = "disable-application-cache";
+//
+// TODO(scherkus): remove --disable-audio when we have a proper fallback
+// mechanism.
+const char kDisableAudio[] = "disable-audio";
// Disable limits on the number of backing stores. Can prevent blinking for
// users with many windows/tabs and lots of memory.
@@ -117,6 +121,9 @@ const char kDisableWebSockets[] = "disable-web-sockets";
// in build/features_override.gypi.
const char kEnableAcceleratedDrawing[] = "enable-accelerated-drawing";
+// Enables WebKit accessibility within the renderer process.
+const char kEnableAccessibility[] = "enable-accessibility";
+
// Enables the benchmarking extensions.
const char kEnableBenchmarking[] = "enable-benchmarking";
@@ -135,6 +142,9 @@ const char kEnableLogging[] = "enable-logging";
// assumed to be sRGB.
const char kEnableMonitorProfile[] = "enable-monitor-profile";
+// Enable Pepper and JavaScript P2P API.
+const char kEnableP2PApi[] = "enable-p2papi";
+
// Enable caching of pre-parsed JS script data. See http://crbug.com/32407.
const char kEnablePreparsedJsCaching[] = "enable-preparsed-js-caching";
@@ -148,6 +158,14 @@ const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox";
// Enables StatsTable, logging statistics to a global named shared memory table.
const char kEnableStatsTable[] = "enable-stats-table";
+// Enables support for fullscreen video. Current implementation is
+// incomplete and this flag is used for development and testing.
+const char kEnableVideoFullscreen[] = "enable-video-fullscreen";
+
+// Enables video logging where video elements log playback performance data to
+// the debug log.
+const char kEnableVideoLogging[] = "enable-video-logging";
+
// Enable web audio API.
const char kEnableWebAudio[] = "enable-webaudio";
@@ -306,6 +324,10 @@ const char kServiceProcess[] = "service";
// Visibly render a border around paint rects in the web page to help debug
// and study painting behavior.
const char kShowPaintRects[] = "show-paint-rects";
+//
+// TODO(scherkus): remove --simple-data-source when our media resource loading
+// is cleaned up and playback testing completed.
+const char kSimpleDataSource[] = "simple-data-source";
// Runs the renderer and plugins in the same process as the browser
const char kSingleProcess[] = "single-process";
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index e37e70a..761b35b 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -16,6 +16,7 @@ extern const char kBrowserSubprocessPath[];
extern const char kDisable3DAPIs[];
extern const char kDisableAcceleratedCompositing[];
extern const char kDisableApplicationCache[];
+extern const char kDisableAudio[];
extern const char kDisableBackingStoreLimit[];
extern const char kDisableDatabases[];
extern const char kDisableDataTransferItems[];
@@ -43,15 +44,19 @@ extern const char kDisableSharedWorkers[];
extern const char kDisableSpeechInput[];
extern const char kDisableWebSockets[];
extern const char kEnableAcceleratedDrawing[];
+extern const char kEnableAccessibility[];
extern const char kEnableBenchmarking[];
extern const char kEnableDeviceMotion[];
extern const char kEnableGPUPlugin[];
extern const char kEnableLogging[];
extern const char kEnableMonitorProfile[];
+extern const char kEnableP2PApi[];
extern const char kEnablePreparsedJsCaching[];
extern const char kEnableSandboxLogging[];
extern const char kEnableSeccompSandbox[];
extern const char kEnableStatsTable[];
+extern const char kEnableVideoFullscreen[];
+extern const char kEnableVideoLogging[];
extern const char kEnableWebAudio[];
extern const char kExperimentalLocationFeatures[];
// TODO(jam): this doesn't belong in content.
@@ -100,6 +105,7 @@ extern const char kSafePlugins[];
// TODO(jam): this doesn't belong in content.
extern const char kServiceProcess[];
extern const char kShowPaintRects[];
+extern const char kSimpleDataSource[];
extern const char kSingleProcess[];
extern const char kTestSandbox[];
extern const char kUnlimitedQuotaForFiles[];
diff --git a/content/common/url_constants.cc b/content/common/url_constants.cc
new file mode 100644
index 0000000..74ce5f4
--- /dev/null
+++ b/content/common/url_constants.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "content/common/url_constants.h"
+
+namespace chrome {
+
+const char kAboutScheme[] = "about";
+const char kBlobScheme[] = "blob";
+const char kChromeDevToolsScheme[] = "chrome-devtools";
+const char kChromeInternalScheme[] = "chrome-internal";
+const char kChromeUIScheme[] = "chrome";
+const char kDataScheme[] = "data";
+const char kExtensionScheme[] = "chrome-extension";
+const char kFileScheme[] = "file";
+const char kFileSystemScheme[] = "filesystem";
+const char kFtpScheme[] = "ftp";
+const char kHttpScheme[] = "http";
+const char kHttpsScheme[] = "https";
+const char kJavaScriptScheme[] = "javascript";
+const char kMailToScheme[] = "mailto";
+const char kMetadataScheme[] = "metadata";
+const char kUserScriptScheme[] = "chrome-user-script";
+const char kViewSourceScheme[] = "view-source";
+
+const char kStandardSchemeSeparator[] = "://";
+
+const char kAboutBlankURL[] = "about:blank";
+const char kAboutCrashURL[] = "about:crash";
+
+const char kUnreachableWebDataURL[] = "chrome://chromewebdata/";
+
+} // namespace chrome
diff --git a/content/common/url_constants.h b/content/common/url_constants.h
new file mode 100644
index 0000000..86ce54d
--- /dev/null
+++ b/content/common/url_constants.h
@@ -0,0 +1,49 @@
+// 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.
+
+// Contains constants for known URLs and portions thereof.
+
+#ifndef CONTENT_COMMON_URL_CONSTANTS_H_
+#define CONTENT_COMMON_URL_CONSTANTS_H_
+#pragma once
+
+#include "content/common/url_constants.h"
+
+namespace chrome {
+
+// Canonical schemes you can use as input to GURL.SchemeIs().
+// TODO(jam): some of these don't below in the content layer, but are accessed
+// from there.
+extern const char kAboutScheme[];
+extern const char kBlobScheme[];
+extern const char kChromeDevToolsScheme[];
+extern const char kChromeInternalScheme[];
+extern const char kChromeUIScheme[]; // The scheme used for WebUIs.
+extern const char kCrosScheme[]; // The scheme used for ChromeOS.
+extern const char kDataScheme[];
+extern const char kExtensionScheme[];
+extern const char kFileScheme[];
+extern const char kFileSystemScheme[];
+extern const char kFtpScheme[];
+extern const char kHttpScheme[];
+extern const char kHttpsScheme[];
+extern const char kJavaScriptScheme[];
+extern const char kMailToScheme[];
+extern const char kMetadataScheme[];
+extern const char kUserScriptScheme[];
+extern const char kViewSourceScheme[];
+
+// Used to separate a standard scheme and the hostname: "://".
+extern const char kStandardSchemeSeparator[];
+
+// About URLs (including schemes).
+extern const char kAboutBlankURL[];
+extern const char kAboutCrashURL[];
+
+// Special URL used to start a navigation to an error page.
+extern const char kUnreachableWebDataURL[];
+
+} // namespace chrome
+
+#endif // CONTENT_COMMON_URL_CONSTANTS_H_
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 8c31bdc..70f25e07 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -65,6 +65,15 @@ struct ViewHostMsg_AccessibilityNotification_Type {
};
};
+// Values that may be OR'd together to form the 'flags' parameter of the
+// ViewMsg_EnablePreferredSizeChangedMode message.
+enum ViewHostMsg_EnablePreferredSizeChangedMode_Flags {
+ kPreferredSizeNothing,
+ kPreferredSizeWidth = 1 << 0,
+ // Requesting the height currently requires a polling loop in render_view.cc.
+ kPreferredSizeHeightThisIsSlow = 1 << 1,
+};
+
struct ViewHostMsg_RunFileChooser_Mode {
public:
enum Value {
@@ -1160,6 +1169,18 @@ IPC_MESSAGE_ROUTED2(ViewMsg_PpapiBrokerChannelCreated,
IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache,
bool /* reload_pages */)
+// Install the first missing pluign.
+IPC_MESSAGE_ROUTED0(ViewMsg_InstallMissingPlugin)
+
+// Sent to the renderer when a popup window should no longer count against
+// the current popup count (either because it's not a popup or because it was
+// a generated by a user action or because a constrained popup got turned
+// into a full window).
+IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount)
+
+// Tells the render view a prerendered page is about to be displayed.
+IPC_MESSAGE_ROUTED0(ViewMsg_DisplayPrerenderedPage)
+
// Messages sent from the renderer to the browser.
@@ -1907,3 +1928,37 @@ IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata,
GURL /* url */,
double /* expected_response_time */,
std::vector<char> /* data */)
+
+// Updates the content restrictions, i.e. to disable print/copy.
+IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateContentRestrictions,
+ int /* restrictions */)
+
+// The currently displayed PDF has an unsupported feature.
+IPC_MESSAGE_ROUTED0(ViewHostMsg_PDFHasUnsupportedFeature)
+
+// Brings up SaveAs... dialog (similar to the wrench->SaveAs...).
+IPC_MESSAGE_ROUTED0(ViewHostMsg_SaveAs)
+
+// Notifies when default plugin updates status of the missing plugin.
+IPC_MESSAGE_ROUTED1(ViewHostMsg_MissingPluginStatus,
+ int /* status */)
+
+// Displays a JavaScript out-of-memory message in the infobar.
+IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory)
+
+// Register a new handler for URL requests with the given scheme.
+IPC_MESSAGE_ROUTED3(ViewHostMsg_RegisterProtocolHandler,
+ std::string /* scheme */,
+ GURL /* url */,
+ string16 /* title */)
+
+// Stores new inspector setting in the profile.
+// TODO(jam): this should be in the chrome module
+IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting,
+ std::string, /* key */
+ std::string /* value */)
+
+// Message sent from the renderer to the browser to notify it of events which
+// may lead to the cancellation of a prerender. The message is sent only when
+// the renderer is in prerender mode.
+IPC_MESSAGE_ROUTED0(ViewHostMsg_MaybeCancelPrerenderForHTML5Media) \ No newline at end of file