summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 22:54:48 +0000
committermihaip@chromium.org <mihaip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 22:54:48 +0000
commitb5e1318a76a2a8c7ae41d172a6c6f2996775ef38 (patch)
treeaa4f64a54681207a602ee35a17201f5dca055217 /chrome
parenta1385e49dded240ad0d8afcb8b5e837e598d2d2b (diff)
downloadchromium_src-b5e1318a76a2a8c7ae41d172a6c6f2996775ef38.zip
chromium_src-b5e1318a76a2a8c7ae41d172a6c6f2996775ef38.tar.gz
chromium_src-b5e1318a76a2a8c7ae41d172a6c6f2996775ef38.tar.bz2
Move transient background events from chrome.experimental.extension to chrome.experimental.runtime
This namespace makes more sense for APIs that are applicable to apps too. R=mpcomplete@chromium.org Review URL: https://chromiumcodereview.appspot.com/9968116 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/api/runtime/runtime_api.cc34
-rw-r--r--chrome/browser/extensions/api/runtime/runtime_api.h23
-rw-r--r--chrome/browser/extensions/extension_event_router.cc5
-rw-r--r--chrome/browser/extensions/extension_module.cc22
-rw-r--r--chrome/browser/extensions/extension_module.h7
-rw-r--r--chrome/chrome_browser_extensions.gypi2
-rw-r--r--chrome/common/common_resources.grd2
-rw-r--r--chrome/common/extensions/api/experimental.runtime.json (renamed from chrome/common/extensions/api/experimental.extension.json)2
-rw-r--r--chrome/common/extensions/api/extension_api.cc4
-rw-r--r--chrome/common/extensions/docs/experimental.html2
-rw-r--r--chrome/common/extensions/docs/experimental.runtime.html (renamed from chrome/common/extensions/docs/experimental.extension.html)12
-rw-r--r--chrome/common/extensions/docs/js/api_page_generator.js2
-rw-r--r--chrome/common/extensions/docs/samples.json6
-rw-r--r--chrome/renderer/extensions/extension_dispatcher.cc2
-rw-r--r--chrome/test/data/extensions/api_test/lazy_background_page/on_installed/background.js2
-rw-r--r--chrome/test/data/extensions/api_test/lazy_background_page/on_unload/background.js2
-rw-r--r--chrome/test/data/extensions/api_test/lazy_background_page/wait_for_request/background.js2
-rw-r--r--chrome/test/data/extensions/api_test/lazy_background_page/wait_for_view/background.js2
18 files changed, 82 insertions, 51 deletions
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc
new file mode 100644
index 0000000..c2e541b
--- /dev/null
+++ b/chrome/browser/extensions/api/runtime/runtime_api.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 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 "chrome/browser/extensions/api/runtime/runtime_api.h"
+
+#include "chrome/common/extensions/extension.h"
+#include "chrome/browser/extensions/extension_event_router.h"
+#include "chrome/browser/profiles/profile.h"
+#include "googleurl/src/gurl.h"
+
+namespace {
+
+const char kOnInstalledEvent[] = "experimental.runtime.onInstalled";
+
+}
+
+namespace extensions {
+
+// static
+void RuntimeEventRouter::DispatchOnInstalledEvent(
+ Profile* profile, const Extension* extension) {
+ // Special case: normally, extensions add their own lazy event listeners.
+ // However, since the extension has just been installed, it hasn't had a
+ // chance to register for events. So we register on its behalf. If the
+ // extension does not actually have a listener, the event will just be
+ // ignored.
+ ExtensionEventRouter* router = profile->GetExtensionEventRouter();
+ router->AddLazyEventListener(kOnInstalledEvent, extension->id());
+ router->DispatchEventToExtension(
+ extension->id(), kOnInstalledEvent, "[]", NULL, GURL());
+}
+
+} // namespace extensions
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.h b/chrome/browser/extensions/api/runtime/runtime_api.h
new file mode 100644
index 0000000..3db5764
--- /dev/null
+++ b/chrome/browser/extensions/api/runtime/runtime_api.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
+#pragma once
+
+class Extension;
+class Profile;
+
+namespace extensions {
+
+class RuntimeEventRouter {
+ public:
+ // Dispatches the onInstalled event to the given extension.
+ static void DispatchOnInstalledEvent(Profile* profile,
+ const Extension* extension);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc
index cfe5fec..5787fb2 100644
--- a/chrome/browser/extensions/extension_event_router.cc
+++ b/chrome/browser/extensions/extension_event_router.cc
@@ -7,10 +7,10 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/values.h"
+#include "chrome/browser/extensions/api/runtime/runtime_api.h"
#include "chrome/browser/extensions/api/web_request/web_request_api.h"
#include "chrome/browser/extensions/extension_devtools_manager.h"
#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/extensions/extension_module.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_processes_api.h"
#include "chrome/browser/extensions/extension_processes_api_constants.h"
@@ -492,7 +492,8 @@ void ExtensionEventRouter::Observe(
// Dispatch the onInstalled event.
const Extension* extension =
content::Details<const Extension>(details).ptr();
- ExtensionModuleEventRouter::DispatchOnInstalledEvent(profile_, extension);
+ extensions::RuntimeEventRouter::DispatchOnInstalledEvent(
+ profile_, extension);
break;
}
diff --git a/chrome/browser/extensions/extension_module.cc b/chrome/browser/extensions/extension_module.cc
index 374d536..f09de0b 100644
--- a/chrome/browser/extensions/extension_module.cc
+++ b/chrome/browser/extensions/extension_module.cc
@@ -6,32 +6,10 @@
#include <string>
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/extensions/extension_event_router.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
-namespace {
-
-const char kOnInstalledEvent[] = "experimental.extension.onInstalled";
-
-}
-
-// static
-void ExtensionModuleEventRouter::DispatchOnInstalledEvent(
- Profile* profile, const Extension* extension) {
- // Special case: normally, extensions add their own lazy event listeners.
- // However, since the extension has just been installed, it hasn't had a
- // chance to register for events. So we register on its behalf. If the
- // extension does not actually have a listener, the event will just be
- // ignored.
- ExtensionEventRouter* router = profile->GetExtensionEventRouter();
- router->AddLazyEventListener(kOnInstalledEvent, extension->id());
- router->DispatchEventToExtension(
- extension->id(), kOnInstalledEvent, "[]", NULL, GURL());
-}
-
ExtensionPrefs* SetUpdateUrlDataFunction::extension_prefs() {
return profile()->GetExtensionService()->extension_prefs();
}
diff --git a/chrome/browser/extensions/extension_module.h b/chrome/browser/extensions/extension_module.h
index 6e0560f3..b7b8551 100644
--- a/chrome/browser/extensions/extension_module.h
+++ b/chrome/browser/extensions/extension_module.h
@@ -10,13 +10,6 @@
class ExtensionPrefs;
-class ExtensionModuleEventRouter {
- public:
- // Dispatches the onInstalled event to the given extension.
- static void DispatchOnInstalledEvent(Profile* profile,
- const Extension* extension);
-};
-
class SetUpdateUrlDataFunction : public SyncExtensionFunction {
protected:
virtual bool RunImpl() OVERRIDE;
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi
index 93e3705..d5e0823 100644
--- a/chrome/chrome_browser_extensions.gypi
+++ b/chrome/chrome_browser_extensions.gypi
@@ -121,6 +121,8 @@
'browser/extensions/api/proxy/proxy_api_constants.h',
'browser/extensions/api/proxy/proxy_api_helpers.cc',
'browser/extensions/api/proxy/proxy_api_helpers.h',
+ 'browser/extensions/api/runtime/runtime_api.cc',
+ 'browser/extensions/api/runtime/runtime_api.h',
'browser/extensions/api/serial/serial_api.cc',
'browser/extensions/api/serial/serial_api.h',
'browser/extensions/api/serial/serial_connection.cc',
diff --git a/chrome/common/common_resources.grd b/chrome/common/common_resources.grd
index 9a444b7..b5344fc 100644
--- a/chrome/common/common_resources.grd
+++ b/chrome/common/common_resources.grd
@@ -29,7 +29,6 @@
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_BOOKMARKMANAGER" file="extensions\api\experimental.bookmarkManager.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_DECLARATIVE" file="extensions\api\experimental.declarative.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_DOWNLOADS" file="extensions\api\experimental.downloads.json" type="BINDATA" />
- <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_EXTENSION" file="extensions\api\experimental.extension.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_FONTSSETTINGS" file="extensions\api\experimental.fontSettings.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_IDENTITY" file="extensions\api\experimental.identity.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_INFOBARS" file="extensions\api\experimental.infobars.json" type="BINDATA" />
@@ -40,6 +39,7 @@
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_OFFSCREENTABS" file="extensions\api\experimental.offscreenTabs.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_PROCESSES" file="extensions\api\experimental.processes.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_RLZ" file="extensions\api\experimental.rlz.json" type="BINDATA" />
+ <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_RUNTIME" file="extensions\api\experimental.runtime.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_SERIAL" file="extensions\api\experimental.serial.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_SOCKET" file="extensions\api\experimental.socket.json" type="BINDATA" />
<include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_SPEECHINPUT" file="extensions\api\experimental.speechInput.json" type="BINDATA" />
diff --git a/chrome/common/extensions/api/experimental.extension.json b/chrome/common/extensions/api/experimental.runtime.json
index 5929593..fb6b2ed 100644
--- a/chrome/common/extensions/api/experimental.extension.json
+++ b/chrome/common/extensions/api/experimental.runtime.json
@@ -4,7 +4,7 @@
[
{
- "namespace": "experimental.extension",
+ "namespace": "experimental.runtime",
"events": [
{
"name": "onInstalled",
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index 3178975..2615d43 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -154,8 +154,6 @@ ExtensionAPI::ExtensionAPI() {
IDR_EXTENSION_API_JSON_EXPERIMENTAL_DECLARATIVE);
unloaded_schemas_["experimental.downloads"] = ReadFromResource(
IDR_EXTENSION_API_JSON_EXPERIMENTAL_DOWNLOADS);
- unloaded_schemas_["experimental.extension"] = ReadFromResource(
- IDR_EXTENSION_API_JSON_EXPERIMENTAL_EXTENSION);
unloaded_schemas_["experimental.fontSettings"] = ReadFromResource(
IDR_EXTENSION_API_JSON_EXPERIMENTAL_FONTSSETTINGS);
unloaded_schemas_["experimental.identity"] = ReadFromResource(
@@ -176,6 +174,8 @@ ExtensionAPI::ExtensionAPI() {
IDR_EXTENSION_API_JSON_EXPERIMENTAL_PROCESSES);
unloaded_schemas_["experimental.rlz"] = ReadFromResource(
IDR_EXTENSION_API_JSON_EXPERIMENTAL_RLZ);
+ unloaded_schemas_["experimental.runtime"] = ReadFromResource(
+ IDR_EXTENSION_API_JSON_EXPERIMENTAL_RUNTIME);
unloaded_schemas_["experimental.serial"] = ReadFromResource(
IDR_EXTENSION_API_JSON_EXPERIMENTAL_SERIAL);
unloaded_schemas_["experimental.socket"] = ReadFromResource(
diff --git a/chrome/common/extensions/docs/experimental.html b/chrome/common/extensions/docs/experimental.html
index 33399b5..564e9ab 100644
--- a/chrome/common/extensions/docs/experimental.html
+++ b/chrome/common/extensions/docs/experimental.html
@@ -242,12 +242,12 @@ on the following experimental APIs:
<a href="experimental.devtools.audits.html">experimental.devtools.audits</a></li><li>
<a href="experimental.devtools.console.html">experimental.devtools.console</a></li><li>
<a href="experimental.downloads.html">experimental.downloads</a></li><li>
- <a href="experimental.extension.html">experimental.extension</a></li><li>
<a href="experimental.fontSettings.html">experimental.fontSettings</a></li><li>
<a href="experimental.infobars.html">experimental.infobars</a></li><li>
<a href="experimental.keybinding.html">experimental.keybinding</a></li><li>
<a href="experimental.managedMode.html">experimental.managedMode</a></li><li>
<a href="experimental.offscreenTabs.html">experimental.offscreenTabs</a></li><li>
+ <a href="experimental.runtime.html">experimental.runtime</a></li><li>
<a href="experimental.speechInput.html">experimental.speechInput</a></li><li>
<a href="experimental.webRequest.html">experimental.webRequest</a></li>
</ul>
diff --git a/chrome/common/extensions/docs/experimental.extension.html b/chrome/common/extensions/docs/experimental.runtime.html
index ced9be0..55aae88 100644
--- a/chrome/common/extensions/docs/experimental.extension.html
+++ b/chrome/common/extensions/docs/experimental.runtime.html
@@ -18,7 +18,7 @@
<script type="text/javascript" src="js/api_page_generator.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
- <meta name="description" content="Documentation for the chrome.experimental.extension module, which is part of the Google Chrome extension APIs."><title>chrome.experimental.extension - Google Chrome Extensions - Google Code</title></head>
+ <meta name="description" content="Documentation for the chrome.experimental.runtime module, which is part of the Google Chrome extension APIs."><title>chrome.experimental.runtime - Google Chrome Extensions - Google Code</title></head>
<body> <div id="devModeWarning" class="displayModeWarning">
You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files.
</div>
@@ -185,14 +185,14 @@
</script>
<div class="g-unit" id="gc-pagecontent">
<div id="pageTitle">
- <h1 class="page_title">chrome.experimental.extension</h1>
+ <h1 class="page_title">chrome.experimental.runtime</h1>
</div>
<!-- TABLE OF CONTENTS -->
<div id="toc">
<h2>Contents</h2>
<ol>
<li>
- <a href="#apiReference">API reference: chrome.experimental.extension</a>
+ <a href="#apiReference">API reference: chrome.experimental.runtime</a>
<ol>
<li>
<a href="#global-events">Events</a>
@@ -218,7 +218,7 @@
<!-- API PAGE -->
<div class="apiPage">
<a name="apiReference"></a>
- <h2>API reference: chrome.experimental.extension</h2>
+ <h2>API reference: chrome.experimental.runtime</h2>
<!-- PROPERTIES -->
<!-- /apiGroup -->
<!-- METHODS -->
@@ -233,7 +233,7 @@
<h4>onBackgroundPageUnloadingSoon</h4>
<div class="summary">
<!-- Note: intentionally longer 80 columns -->
- <span class="subdued">chrome.experimental.extension.</span><span>onBackgroundPageUnloadingSoon</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span><span></span>);
+ <span class="subdued">chrome.experimental.runtime.</span><span>onBackgroundPageUnloadingSoon</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span><span></span>);
</div>
<div class="description">
<p>Sent to the transient background page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete.</p>
@@ -248,7 +248,7 @@
<h4>onInstalled</h4>
<div class="summary">
<!-- Note: intentionally longer 80 columns -->
- <span class="subdued">chrome.experimental.extension.</span><span>onInstalled</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span><span></span>);
+ <span class="subdued">chrome.experimental.runtime.</span><span>onInstalled</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span><span></span>);
</div>
<div class="description">
<p>Fired when the extension is first installed.</p>
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js
index c2c685e..c8d901d 100644
--- a/chrome/common/extensions/docs/js/api_page_generator.js
+++ b/chrome/common/extensions/docs/js/api_page_generator.js
@@ -35,7 +35,6 @@ var MODULE_SCHEMAS = [
'../api/experimental.app.json',
'../api/experimental.bookmarkManager.json',
'../api/experimental.downloads.json',
- '../api/experimental.extension.json',
'../api/experimental.fontSettings.json',
'../api/experimental.identity.json',
'../api/experimental.infobars.json',
@@ -46,6 +45,7 @@ var MODULE_SCHEMAS = [
'../api/experimental.offscreenTabs.json',
'../api/experimental.processes.json',
'../api/experimental.rlz.json',
+ '../api/experimental.runtime.json',
'../api/experimental.serial.json',
'../api/experimental.socket.json',
'../api/experimental.speechInput.json',
diff --git a/chrome/common/extensions/docs/samples.json b/chrome/common/extensions/docs/samples.json
index 6ad9615..9e80036 100644
--- a/chrome/common/extensions/docs/samples.json
+++ b/chrome/common/extensions/docs/samples.json
@@ -107,8 +107,6 @@
"chrome.experimental.devtools.console.getMessages": "experimental.devtools.console.html#method-getMessages",
"chrome.experimental.devtools.console.onMessageAdded": "experimental.devtools.console.html#event-onMessageAdded",
"chrome.experimental.downloads.download": "experimental.downloads.html#method-download",
- "chrome.experimental.extension.onBackgroundPageUnloadingSoon": "experimental.extension.html#event-onBackgroundPageUnloadingSoon",
- "chrome.experimental.extension.onInstalled": "experimental.extension.html#event-onInstalled",
"chrome.experimental.fontSettings.getDefaultFixedFontSize": "experimental.fontSettings.html#method-getDefaultFixedFontSize",
"chrome.experimental.fontSettings.getDefaultFontSize": "experimental.fontSettings.html#method-getDefaultFontSize",
"chrome.experimental.fontSettings.getFontList": "experimental.fontSettings.html#method-getFontList",
@@ -131,6 +129,8 @@
"chrome.experimental.offscreenTabs.sendMouseEvent": "experimental.offscreenTabs.html#method-sendMouseEvent",
"chrome.experimental.offscreenTabs.toDataUrl": "experimental.offscreenTabs.html#method-toDataUrl",
"chrome.experimental.offscreenTabs.update": "experimental.offscreenTabs.html#method-update",
+ "chrome.experimental.runtime.onBackgroundPageUnloadingSoon": "experimental.runtime.html#event-onBackgroundPageUnloadingSoon",
+ "chrome.experimental.runtime.onInstalled": "experimental.runtime.html#event-onInstalled",
"chrome.experimental.speechInput.isRecording": "experimental.speechInput.html#method-isRecording",
"chrome.experimental.speechInput.onError": "experimental.speechInput.html#event-onError",
"chrome.experimental.speechInput.onResult": "experimental.speechInput.html#event-onResult",
@@ -2625,4 +2625,4 @@
"zip_path": "examples\/api\/extension\/isAllowedAccess.zip"
}
]
-} \ No newline at end of file
+}
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index 57580f8..d0a53c9 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -86,7 +86,7 @@ static const int64 kInitialExtensionIdleHandlerDelayMs = 5*1000;
static const int64 kMaxExtensionIdleHandlerDelayMs = 5*60*1000;
static const char kEventDispatchFunction[] = "Event.dispatchJSON";
static const char kOnUnloadEvent[] =
- "experimental.extension.onBackgroundPageUnloadingSoon";
+ "experimental.runtime.onBackgroundPageUnloadingSoon";
class ChromeHiddenNativeHandler : public NativeHandler {
public:
diff --git a/chrome/test/data/extensions/api_test/lazy_background_page/on_installed/background.js b/chrome/test/data/extensions/api_test/lazy_background_page/on_installed/background.js
index 2e2d9c0..09ab2f4 100644
--- a/chrome/test/data/extensions/api_test/lazy_background_page/on_installed/background.js
+++ b/chrome/test/data/extensions/api_test/lazy_background_page/on_installed/background.js
@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.experimental.extension.onInstalled.addListener(function() {
+chrome.experimental.runtime.onInstalled.addListener(function() {
chrome.test.notifyPass();
});
diff --git a/chrome/test/data/extensions/api_test/lazy_background_page/on_unload/background.js b/chrome/test/data/extensions/api_test/lazy_background_page/on_unload/background.js
index 71508c6..4f24c53 100644
--- a/chrome/test/data/extensions/api_test/lazy_background_page/on_unload/background.js
+++ b/chrome/test/data/extensions/api_test/lazy_background_page/on_unload/background.js
@@ -3,7 +3,7 @@
// found in the LICENSE file.
chrome.browserAction.setTitle({title: "Failure"});
-chrome.experimental.extension.onBackgroundPageUnloadingSoon.addListener(
+chrome.experimental.runtime.onBackgroundPageUnloadingSoon.addListener(
function() {
chrome.browserAction.setTitle({title: "Success"});
});
diff --git a/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_request/background.js b/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_request/background.js
index c17447b..70d6317 100644
--- a/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_request/background.js
+++ b/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_request/background.js
@@ -15,7 +15,7 @@ function abortRequest() {
window.domAutomationController.send(true);
}
-chrome.experimental.extension.onInstalled.addListener(function() {
+chrome.experimental.runtime.onInstalled.addListener(function() {
chrome.test.getConfig(function(config) {
testServerPort = config.testServer.port;
diff --git a/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_view/background.js b/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_view/background.js
index 4e41a9f..56ac614 100644
--- a/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_view/background.js
+++ b/chrome/test/data/extensions/api_test/lazy_background_page/wait_for_view/background.js
@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.experimental.extension.onInstalled.addListener(function() {
+chrome.experimental.runtime.onInstalled.addListener(function() {
chrome.tabs.create({url: "extension_page.html"}, chrome.test.callbackPass());
});