From 16e3d45d6fd4a2203ddb248d636dcd320a3639f0 Mon Sep 17 00:00:00 2001 From: "twiz@chromium.org" Date: Fri, 30 Apr 2010 22:39:22 +0000 Subject: Clean-up of the asynchronous behaviour of the experimental extension popup API. - It was previously possible to programmatically launch two popups from the same extension. (Simply call popup.show twice in a row, or in a callback chain.) I removed this incorrect funcationality by registering ExtensionPopupHost to listen for EXTENSION_HOST_CREATED notifications. If a popup is shown, and a new ExtensionHost is constructed of type EXTENSION_POPUP, then the presently displayed popup is dismissed. - The callback function for popup.show(...) was previously called in response to EXTENSION_POPUP_VIEW_READY, as processed in response to a ViewHostMsg_DocumentAvailableInMainFrame message. This message wassent after PARSING of the conent of the popup view. Because of this behaviour, the API was difficult to use because one could not meaningfully interact with the popup page during the callback: The callback would race with completion of the onload handler within the popup, so some sort of polling for onload-complete was required. I fixed the problem by adding new notifications and messages so that EXTENSION_POPUP_VIEW_READY is now sent only after all onload handlers have been invoked.Corresponding unit-tests have also been added. BUG=None TEST=ExtensionApiTest.Popup Review URL: http://codereview.chromium.org/1512007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46136 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/api/extension_api.json | 4 +- chrome/common/extensions/docs/extension.html | 2 +- chrome/common/extensions/docs/history.html | 122 ++++++++++++------------ 3 files changed, 64 insertions(+), 64 deletions(-) (limited to 'chrome/common/extensions') diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 5db6983..99e07f9 100644 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -134,9 +134,9 @@ "properties": { "type": { "type": "string", - "enum": ["tab", "infobar", "notification"], + "enum": ["tab", "infobar", "notification", "popup"], "optional": true, - "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification'." + "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification', 'popup'." }, "windowId": { "type": "integer", diff --git a/chrome/common/extensions/docs/extension.html b/chrome/common/extensions/docs/extension.html index 113b81a..3c7f0cb 100644 --- a/chrome/common/extensions/docs/extension.html +++ b/chrome/common/extensions/docs/extension.html @@ -1158,7 +1158,7 @@ For details, see -
The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification'.
+
The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification', 'popup'.
diff --git a/chrome/common/extensions/docs/history.html b/chrome/common/extensions/docs/history.html index 7079c0c..a6bf9b1 100644 --- a/chrome/common/extensions/docs/history.html +++ b/chrome/common/extensions/docs/history.html @@ -266,9 +266,9 @@ Types
  1. - VisitItem -
  2. HistoryItem +
  3. + VisitItem
@@ -1874,8 +1874,8 @@ For other examples and for help in viewing the source code, see
- -

VisitItem

+ +

HistoryItem

@@ -1905,7 +1905,7 @@ For other examples and for help in viewing the source code, see
-
An object encapsulating one visit to a URL.
+
An object encapsulating one result of a history query.
@@ -1954,13 +1954,13 @@ For other examples and for help in viewing the source code, see
- visitId + url
( - + optional Type @@ -1980,7 +1980,7 @@ For other examples and for help in viewing the source code, see
-
The unique identifier for this visit.
+
The URL navigated to by a user.
@@ -1995,7 +1995,7 @@ For other examples and for help in viewing the source code, see
- visitTime + title @@ -2010,7 +2010,7 @@ For other examples and for help in viewing the source code, see array of - number + string ) @@ -2021,7 +2021,7 @@ For other examples and for help in viewing the source code, see
-
When this visit occurred, represented in milliseconds since the epoch.
+
The title of the history page.
@@ -2036,13 +2036,13 @@ For other examples and for help in viewing the source code, see
- referringVisitId + lastVisitTime
( - + optional Type @@ -2051,7 +2051,7 @@ For other examples and for help in viewing the source code, see array of - string + number ) @@ -2062,7 +2062,7 @@ For other examples and for help in viewing the source code, see
-
The visit_id of the referrer.
+
When this page was last loaded, represented in milliseconds since the epoch.
@@ -2077,13 +2077,13 @@ For other examples and for help in viewing the source code, see
- transition + visitCount
( - + optional Type @@ -2092,7 +2092,7 @@ For other examples and for help in viewing the source code, see array of - string + integer ) @@ -2103,7 +2103,7 @@ For other examples and for help in viewing the source code, see
-
The transition type for this visit from its referrer.
+
The number of times the user has navigated to this page.
@@ -2115,24 +2115,16 @@ For other examples and for help in viewing the source code, see
- - - - - -
- -

HistoryItem

- -
+
+
- paramName + typedCount
( - + optional Type @@ -2141,7 +2133,7 @@ For other examples and for help in viewing the source code, see array of - object + integer ) @@ -2152,15 +2144,30 @@ For other examples and for help in viewing the source code, see
-
An object encapsulating one result of a history query.
+
The number of times the user has navigated to this page by typing in the address.
-
+
+
+
+
+
+
+
+ + +
+ +
+ +

VisitItem

+ +
- id + paramName @@ -2175,7 +2182,7 @@ For other examples and for help in viewing the source code, see array of - string + object ) @@ -2186,28 +2193,21 @@ For other examples and for help in viewing the source code, see
-
The unique identifier for the item.
+
An object encapsulating one visit to a URL.
-
+
-
-
-
-
-
-
-
- url + id
( - optional + Type @@ -2227,7 +2227,7 @@ For other examples and for help in viewing the source code, see
-
The URL navigated to by a user.
+
The unique identifier for the item.
@@ -2242,13 +2242,13 @@ For other examples and for help in viewing the source code, see
- title + visitId
( - optional + Type @@ -2268,7 +2268,7 @@ For other examples and for help in viewing the source code, see
-
The title of the history page.
+
The unique identifier for this visit.
@@ -2283,7 +2283,7 @@ For other examples and for help in viewing the source code, see
- lastVisitTime + visitTime @@ -2309,7 +2309,7 @@ For other examples and for help in viewing the source code, see
-
When this page was last loaded, represented in milliseconds since the epoch.
+
When this visit occurred, represented in milliseconds since the epoch.
@@ -2324,13 +2324,13 @@ For other examples and for help in viewing the source code, see
- visitCount + referringVisitId
( - optional + Type @@ -2339,7 +2339,7 @@ For other examples and for help in viewing the source code, see array of - integer + string ) @@ -2350,7 +2350,7 @@ For other examples and for help in viewing the source code, see
-
The number of times the user has navigated to this page.
+
The visit_id of the referrer.
@@ -2365,13 +2365,13 @@ For other examples and for help in viewing the source code, see
- typedCount + transition
( - optional + Type @@ -2380,7 +2380,7 @@ For other examples and for help in viewing the source code, see array of - integer + string ) @@ -2391,7 +2391,7 @@ For other examples and for help in viewing the source code, see
-
The number of times the user has navigated to this page by typing in the address.
+
The transition type for this visit from its referrer.
-- cgit v1.1