diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 03:00:40 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 03:00:40 +0000 |
commit | e8345245dbeed71eed592c8a89e4b70403019e47 (patch) | |
tree | 5b9e56c874df5de0cee3656c8c901a2f41f51c32 /chrome/common | |
parent | 622b74522b0ee8aa0343dd48fbbd0230e9806d5e (diff) | |
download | chromium_src-e8345245dbeed71eed592c8a89e4b70403019e47.zip chromium_src-e8345245dbeed71eed592c8a89e4b70403019e47.tar.gz chromium_src-e8345245dbeed71eed592c8a89e4b70403019e47.tar.bz2 |
Initial support for web-extent background pages.
This patch adds a new RVH container: BackgroundContents. The idea is that apps can open a live web-page as a "background" page using window.open('<url>', '<name>', 'background');
If 'background' is specified and the opener is within the app's extent, a BackgroundContents will be used. Otherwise, the 'background' feature is ignored and it is treated as a regular popup call.
Note that as of this patch the following are explicitly not-yet addressed:
1) Session storage for BackgroundContents
2) SSL (or other failures) requiring UI
3) Javascript messages (alert, etc...)
4) Session restore
TEST=All tests should pass
BUG=41275
Review URL: http://codereview.chromium.org/1734014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/extensions/extension.cc | 2 | ||||
-rw-r--r-- | chrome/common/extensions/extension.h | 1 | ||||
-rw-r--r-- | chrome/common/extensions/extension_constants.h | 4 | ||||
-rw-r--r-- | chrome/common/notification_type.h | 10 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 8 | ||||
-rw-r--r-- | chrome/common/view_types.h | 1 |
6 files changed, 22 insertions, 4 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 4c82ad1..fad9130 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -119,6 +119,7 @@ const int Extension::kIconSizes[] = { const int Extension::kPageActionIconMaxSize = 19; const int Extension::kBrowserActionIconMaxSize = 19; +const char* Extension::kBackgroundPermission = "background"; const char* Extension::kBookmarkPermission = "bookmarks"; const char* Extension::kExperimentalPermission = "experimental"; const char* Extension::kGeolocationPermission = "geolocation"; @@ -128,6 +129,7 @@ const char* Extension::kTabPermission = "tabs"; const char* Extension::kUnlimitedStoragePermission = "unlimited_storage"; const char* Extension::kPermissionNames[] = { + Extension::kBackgroundPermission, Extension::kBookmarkPermission, Extension::kExperimentalPermission, Extension::kGeolocationPermission, diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 7a1fe93..be015d2 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -87,6 +87,7 @@ class Extension { static const int kBrowserActionIconMaxSize; // Each permission is a module that the extension is permitted to use. + static const char* kBackgroundPermission; static const char* kBookmarkPermission; static const char* kExperimentalPermission; static const char* kGeolocationPermission; diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h index 36ba762..2353b35 100644 --- a/chrome/common/extensions/extension_constants.h +++ b/chrome/common/extensions/extension_constants.h @@ -188,4 +188,8 @@ namespace extension_filenames { extern const char* kDecodedMessageCatalogsFilename; } +namespace extension_misc { + const int kUnknownWindowId = -1; +} // extension_misc + #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_CONSTANTS_H_ diff --git a/chrome/common/notification_type.h b/chrome/common/notification_type.h index d2463a5..d8b46b4 100644 --- a/chrome/common/notification_type.h +++ b/chrome/common/notification_type.h @@ -467,6 +467,16 @@ class NotificationType { // view host for the page, there are no details. FOCUS_CHANGED_IN_PAGE, + // BackgroundContents ------------------------------------------------------ + + // The background contents navigated to a new location. The source is the + // BackgroundContents, and the details are contained RenderViewHost. + BACKGROUND_CONTENTS_NAVIGATED, + + // The background contents is being deleted. The source is the + // BackgroundContents, and the details are the contained RendeViewHost. + BACKGROUND_CONTENTS_DELETED, + // Child Processes --------------------------------------------------------- // This notification is sent when a child process host has connected to a diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index d575873..2bc18dd 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -654,11 +654,11 @@ IPC_BEGIN_MESSAGES(View) int /* id of the request message */, webkit_glue::FormData /* form data */) - // Sent by the Browser process to alert a window about whether a blocked - // popup notification is visible. The renderer assumes every new window is a + // Sent by the Browser process to alert a window about whether a it should + // allow a scripted window.close(). The renderer assumes every new window is a // blocked popup until notified otherwise. - IPC_MESSAGE_ROUTED1(ViewMsg_PopupNotificationVisibilityChanged, - bool /* Whether it is visible */) + IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, + bool /* script_can_close */) // Sent by AudioRendererHost to renderer to request an audio packet. IPC_MESSAGE_ROUTED3(ViewMsg_RequestAudioPacket, diff --git a/chrome/common/view_types.h b/chrome/common/view_types.h index d3f1782..f74eb36 100644 --- a/chrome/common/view_types.h +++ b/chrome/common/view_types.h @@ -12,6 +12,7 @@ class ViewType { public: enum Type { INVALID, + BACKGROUND_CONTENTS, TAB_CONTENTS, EXTENSION_TOOLSTRIP, EXTENSION_MOLE, |