summaryrefslogtreecommitdiffstats
path: root/content/public
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 20:25:18 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-31 20:25:18 +0000
commit4573fbd30d7ed70f959efb69b32ad9547465f0ce (patch)
tree958d424cf2dfa7b22aba942c8ebc383a5ba22517 /content/public
parent5262dc192af688c4f9301753fa7890975303b909 (diff)
downloadchromium_src-4573fbd30d7ed70f959efb69b32ad9547465f0ce.zip
chromium_src-4573fbd30d7ed70f959efb69b32ad9547465f0ce.tar.gz
chromium_src-4573fbd30d7ed70f959efb69b32ad9547465f0ce.tar.bz2
Move content_restriction.h and main_function_params.h to content/public/common, and put them in the content namespace.
BUG=98716 Review URL: http://codereview.chromium.org/8387039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108004 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r--content/public/app/content_main_delegate.h8
-rw-r--r--content/public/browser/content_browser_client.h4
-rw-r--r--content/public/common/content_restriction.h23
-rw-r--r--content/public/common/main_function_params.h53
4 files changed, 82 insertions, 6 deletions
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
index e8e2fde..6fd40b0 100644
--- a/content/public/app/content_main_delegate.h
+++ b/content/public/app/content_main_delegate.h
@@ -10,11 +10,10 @@
#include "build/build_config.h"
-struct MainFunctionParams;
-
namespace content {
class ZygoteForkDelegate;
+struct MainFunctionParams;
class ContentMainDelegate {
public:
@@ -36,8 +35,9 @@ class ContentMainDelegate {
virtual void SandboxInitialized(const std::string& process_type) = 0;
// Asks the embedder to start a process that content doesn't know about.
- virtual int RunProcess(const std::string& process_type,
- const MainFunctionParams& main_function_params) = 0;
+ virtual int RunProcess(
+ const std::string& process_type,
+ const content::MainFunctionParams& main_function_params) = 0;
// Called right before the process exits.
virtual void ProcessExiting(const std::string& process_type) = 0;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 4d4f1ad..8ec5549 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -35,11 +35,11 @@ class TabContents;
class TabContentsView;
class WorkerProcessHost;
struct DesktopNotificationHostMsg_Show_Params;
-struct MainFunctionParams;
struct WebPreferences;
namespace content {
class BrowserMainParts;
+struct MainFunctionParams;
}
namespace crypto {
@@ -86,7 +86,7 @@ class ContentBrowserClient {
// implementations for the browser startup code. See comments in
// browser_main_parts.h.
virtual void CreateBrowserMainParts(
- const MainFunctionParams& parameters,
+ const content::MainFunctionParams& parameters,
std::vector<BrowserMainParts*>* parts_list) = 0;
// Platform-specific creator. Use this to construct new RenderWidgetHostViews
diff --git a/content/public/common/content_restriction.h b/content/public/common/content_restriction.h
new file mode 100644
index 0000000..3ea577d
--- /dev/null
+++ b/content/public/common/content_restriction.h
@@ -0,0 +1,23 @@
+// 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_PUBLIC_COMMON_CONTENT_RESTRICTION_H_
+#define CONTENT_PUBLIC_COMMON_CONTENT_RESTRICTION_H_
+#pragma once
+
+namespace content {
+
+// 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
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_CONTENT_RESTRICTION_H_
diff --git a/content/public/common/main_function_params.h b/content/public/common/main_function_params.h
new file mode 100644
index 0000000..2a8a16d
--- /dev/null
+++ b/content/public/common/main_function_params.h
@@ -0,0 +1,53 @@
+// 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.
+
+// Wrapper to the parameter list for the "main" entry points (browser, renderer,
+// plugin) to shield the call sites from the differences between platforms
+// (e.g., POSIX doesn't need to pass any sandbox information).
+
+#ifndef CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_
+#define CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_
+#pragma once
+
+#include "base/command_line.h"
+
+#if defined(OS_WIN)
+namespace sandbox {
+struct SandboxInterfaceInfo;
+}
+#elif defined(OS_MACOSX)
+namespace base {
+namespace mac {
+class ScopedNSAutoreleasePool;
+}
+}
+#endif
+
+class Task;
+
+namespace content {
+
+struct MainFunctionParams {
+ explicit MainFunctionParams(const CommandLine& cl)
+ : command_line(cl),
+#if defined(OS_WIN)
+ sandbox_info(NULL),
+#elif defined(OS_MACOSX)
+ autorelease_pool(NULL),
+#endif
+ ui_task(NULL) {}
+ const CommandLine& command_line;
+#if defined(OS_WIN)
+ sandbox::SandboxInterfaceInfo* sandbox_info;
+#elif defined(OS_MACOSX)
+ base::mac::ScopedNSAutoreleasePool* autorelease_pool;
+#endif
+ // Used by InProcessBrowserTest. If non-null BrowserMain schedules this
+ // task to run on the MessageLoop and BrowserInit is not invoked.
+ Task* ui_task;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_MAIN_FUNCTION_PARAMS_H_