diff options
Diffstat (limited to 'content/public/common')
-rw-r--r-- | content/public/common/content_restriction.h | 23 | ||||
-rw-r--r-- | content/public/common/main_function_params.h | 53 |
2 files changed, 76 insertions, 0 deletions
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_ |