summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-01-07 14:18:56 +0000
committerBen Murdoch <benm@google.com>2011-01-11 10:23:13 +0000
commit201ade2fbba22bfb27ae029f4d23fca6ded109a0 (patch)
treeb793f4ed916f73cf18357ea467ff3deb5ffb5b52 /chrome/common
parentd8c4c37a7d0961944bfdfaa117d5c68c8e129c97 (diff)
downloadexternal_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.zip
external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.tar.gz
external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.tar.bz2
Merge chromium at 9.0.597.55: Initial merge by git.
Change-Id: Id686a88437441ec7e17abb3328a404c7b6c3c6ad
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/automation_constants.cc9
-rw-r--r--chrome/common/automation_constants.h10
-rw-r--r--chrome/common/badge_util.cc99
-rw-r--r--chrome/common/badge_util.h32
-rw-r--r--chrome/common/child_process_info.cc2
-rw-r--r--chrome/common/chrome_paths_internal.h9
-rw-r--r--chrome/common/chrome_paths_linux.cc27
-rw-r--r--chrome/common/chrome_paths_mac.mm22
-rw-r--r--chrome/common/chrome_paths_unittest.cc44
-rw-r--r--chrome/common/chrome_paths_win.cc5
-rw-r--r--chrome/common/chrome_switches.cc33
-rw-r--r--chrome/common/chrome_switches.h11
-rw-r--r--chrome/common/common_param_traits.cc4
-rw-r--r--chrome/common/extensions/api/extension_api.json88
-rw-r--r--chrome/common/extensions/docs/a11y.html7
-rw-r--r--chrome/common/extensions/docs/api_index.html7
-rw-r--r--chrome/common/extensions/docs/api_other.html7
-rw-r--r--chrome/common/extensions/docs/apps.html (renamed from chrome/common/extensions/docs/experimental.omnibox.html)230
-rw-r--r--chrome/common/extensions/docs/autoupdate.html11
-rw-r--r--chrome/common/extensions/docs/background_pages.html7
-rw-r--r--chrome/common/extensions/docs/bookmarks.html7
-rw-r--r--chrome/common/extensions/docs/browserAction.html12
-rw-r--r--chrome/common/extensions/docs/content_scripts.html7
-rw-r--r--chrome/common/extensions/docs/contextMenus.html9
-rw-r--r--chrome/common/extensions/docs/cookies.html7
-rw-r--r--chrome/common/extensions/docs/crx.html7
-rw-r--r--chrome/common/extensions/docs/devguide.html19
-rw-r--r--chrome/common/extensions/docs/docs.html30
-rw-r--r--chrome/common/extensions/docs/events.html7
-rw-r--r--chrome/common/extensions/docs/examples/extensions/chrome_search/background.html131
-rw-r--r--chrome/common/extensions/docs/experimental.clipboard.html7
-rw-r--r--chrome/common/extensions/docs/experimental.contextMenus.html7
-rw-r--r--chrome/common/extensions/docs/experimental.cookies.html7
-rw-r--r--chrome/common/extensions/docs/experimental.history.html7
-rw-r--r--chrome/common/extensions/docs/experimental.html11
-rw-r--r--chrome/common/extensions/docs/experimental.idle.html7
-rw-r--r--chrome/common/extensions/docs/experimental.infobars.html7
-rw-r--r--chrome/common/extensions/docs/experimental.processes.html7
-rw-r--r--chrome/common/extensions/docs/experimental.proxy.html7
-rw-r--r--chrome/common/extensions/docs/experimental.sidebar.html9
-rw-r--r--chrome/common/extensions/docs/experimental.webNavigation.html7
-rw-r--r--chrome/common/extensions/docs/experimental.webRequest.html7
-rw-r--r--chrome/common/extensions/docs/extension.html9
-rw-r--r--chrome/common/extensions/docs/external_extensions.html7
-rw-r--r--chrome/common/extensions/docs/faq.html79
-rw-r--r--chrome/common/extensions/docs/getstarted.html10
-rw-r--r--chrome/common/extensions/docs/history.html7
-rw-r--r--chrome/common/extensions/docs/hosting.html153
-rw-r--r--chrome/common/extensions/docs/i18n-messages.html7
-rw-r--r--chrome/common/extensions/docs/i18n.html13
-rw-r--r--chrome/common/extensions/docs/idle.html7
-rw-r--r--chrome/common/extensions/docs/images/omnibox.pngbin47902 -> 47242 bytes
-rw-r--r--chrome/common/extensions/docs/images/perms-hw1.pngbin32298 -> 20247 bytes
-rw-r--r--chrome/common/extensions/docs/images/perms-hw2.pngbin37899 -> 22511 bytes
-rw-r--r--chrome/common/extensions/docs/index.html118
-rw-r--r--chrome/common/extensions/docs/management.html205
-rw-r--r--chrome/common/extensions/docs/manifest.html117
-rw-r--r--chrome/common/extensions/docs/match_patterns.html7
-rw-r--r--chrome/common/extensions/docs/messaging.html7
-rw-r--r--chrome/common/extensions/docs/notifications.html7
-rw-r--r--chrome/common/extensions/docs/npapi.html7
-rw-r--r--chrome/common/extensions/docs/omnibox.html1939
-rw-r--r--chrome/common/extensions/docs/options.html7
-rw-r--r--chrome/common/extensions/docs/override.html7
-rw-r--r--chrome/common/extensions/docs/overview.html125
-rw-r--r--chrome/common/extensions/docs/packaging.html16
-rw-r--r--chrome/common/extensions/docs/pageAction.html12
-rw-r--r--chrome/common/extensions/docs/permission_warnings.html69
-rw-r--r--chrome/common/extensions/docs/samples.html7
-rw-r--r--chrome/common/extensions/docs/static/apps.html171
-rw-r--r--chrome/common/extensions/docs/static/autoupdate.html4
-rw-r--r--chrome/common/extensions/docs/static/browserAction.html5
-rw-r--r--chrome/common/extensions/docs/static/devguide.html12
-rw-r--r--chrome/common/extensions/docs/static/docs.html23
-rw-r--r--chrome/common/extensions/docs/static/experimental.html4
-rw-r--r--chrome/common/extensions/docs/static/faq.html72
-rw-r--r--chrome/common/extensions/docs/static/getstarted.html3
-rw-r--r--chrome/common/extensions/docs/static/hosting.html131
-rw-r--r--chrome/common/extensions/docs/static/i18n.html6
-rw-r--r--chrome/common/extensions/docs/static/index.html115
-rw-r--r--chrome/common/extensions/docs/static/manifest.html108
-rw-r--r--chrome/common/extensions/docs/static/omnibox.html (renamed from chrome/common/extensions/docs/static/experimental.omnibox.html)22
-rw-r--r--chrome/common/extensions/docs/static/overview.html116
-rw-r--r--chrome/common/extensions/docs/static/packaging.html8
-rw-r--r--chrome/common/extensions/docs/static/pageAction.html5
-rw-r--r--chrome/common/extensions/docs/static/permission_warnings.html66
-rw-r--r--chrome/common/extensions/docs/static/tabs.html13
-rw-r--r--chrome/common/extensions/docs/static/tut_analytics.html2
-rw-r--r--chrome/common/extensions/docs/static/whats_new.html13
-rw-r--r--chrome/common/extensions/docs/static/xhr.html6
-rw-r--r--chrome/common/extensions/docs/tabs.html20
-rw-r--r--chrome/common/extensions/docs/template/api_template.html7
-rw-r--r--chrome/common/extensions/docs/themes.html9
-rw-r--r--chrome/common/extensions/docs/tut_analytics.html9
-rw-r--r--chrome/common/extensions/docs/tut_debugging.html7
-rw-r--r--chrome/common/extensions/docs/tut_oauth.html7
-rw-r--r--chrome/common/extensions/docs/tutorials.html7
-rw-r--r--chrome/common/extensions/docs/whats_new.html20
-rw-r--r--chrome/common/extensions/docs/windows.html7
-rw-r--r--chrome/common/extensions/docs/xhr.html13
-rw-r--r--chrome/common/extensions/extension.cc206
-rw-r--r--chrome/common/extensions/extension.h75
-rw-r--r--chrome/common/extensions/extension_action.cc45
-rw-r--r--chrome/common/extensions/extension_constants.cc6
-rw-r--r--chrome/common/extensions/extension_constants.h5
-rw-r--r--chrome/common/extensions/extension_manifests_unittest.cc14
-rw-r--r--chrome/common/extensions/extension_unittest.cc192
-rw-r--r--chrome/common/file_system/webfilesystem_callback_dispatcher.cc5
-rw-r--r--chrome/common/gpu_messages.cc49
-rw-r--r--chrome/common/gpu_messages_internal.h45
-rw-r--r--chrome/common/gpu_param_traits.h19
-rw-r--r--chrome/common/indexed_db_key.cc2
-rw-r--r--chrome/common/indexed_db_key.h6
-rw-r--r--chrome/common/indexed_db_param_traits.cc2
-rw-r--r--chrome/common/metrics_helpers.cc1
-rw-r--r--chrome/common/multi_process_lock_linux.cc3
-rw-r--r--chrome/common/multi_process_lock_mac.cc3
-rw-r--r--chrome/common/multi_process_lock_win.cc3
-rw-r--r--chrome/common/net/gaia/gaia_auth_consumer.h9
-rw-r--r--chrome/common/net/gaia/gaia_auth_fetcher.cc9
-rw-r--r--chrome/common/net/gaia/gaia_auth_fetcher.h3
-rw-r--r--chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc20
-rw-r--r--chrome/common/net/test_url_fetcher_factory.cc1
-rw-r--r--chrome/common/net/url_fetcher.cc158
-rw-r--r--chrome/common/net/url_fetcher.h10
-rw-r--r--chrome/common/net/url_fetcher_protect.cc180
-rw-r--r--chrome/common/net/url_fetcher_protect.h152
-rw-r--r--chrome/common/net/url_fetcher_unittest.cc127
-rw-r--r--chrome/common/net/url_request_intercept_job.h13
-rw-r--r--chrome/common/notification_type.h37
-rw-r--r--chrome/common/plugin_messages.cc9
-rw-r--r--chrome/common/plugin_messages.h1
-rw-r--r--chrome/common/plugin_messages_internal.h17
-rw-r--r--chrome/common/pref_names.cc39
-rw-r--r--chrome/common/pref_names.h16
-rw-r--r--chrome/common/property_bag.h4
-rw-r--r--chrome/common/render_messages.cc20
-rw-r--r--chrome/common/render_messages_internal.h66
-rw-r--r--chrome/common/render_messages_params.cc56
-rw-r--r--chrome/common/render_messages_params.h34
-rw-r--r--chrome/common/resource_dispatcher.cc21
-rw-r--r--chrome/common/resource_dispatcher.h5
-rw-r--r--chrome/common/service_process_util.h2
-rw-r--r--chrome/common/switch_utils.cc1
-rw-r--r--chrome/common/url_constants.cc10
-rw-r--r--chrome/common/url_constants.h4
-rw-r--r--chrome/common/web_apps.cc23
-rw-r--r--chrome/common/web_apps.h4
-rw-r--r--chrome/common/web_apps_unittest.cc5
-rw-r--r--chrome/common/worker_messages_internal.h9
150 files changed, 5019 insertions, 1670 deletions
diff --git a/chrome/common/automation_constants.cc b/chrome/common/automation_constants.cc
index c253871..9480254 100644
--- a/chrome/common/automation_constants.cc
+++ b/chrome/common/automation_constants.cc
@@ -5,6 +5,7 @@
#include "chrome/common/automation_constants.h"
namespace automation {
+
// JSON value labels for proxy settings that are passed in via
// AutomationMsg_SetProxyConfig.
const char kJSONProxyAutoconfig[] = "proxy.autoconfig";
@@ -12,4 +13,10 @@ const char kJSONProxyNoProxy[] = "proxy.no_proxy";
const char kJSONProxyPacUrl[] = "proxy.pac_url";
const char kJSONProxyBypassList[] = "proxy.bypass_list";
const char kJSONProxyServer[] = "proxy.server";
-}
+
+// Named testing interface is used when you want to connect an
+// AutomationProxy to an already-running browser instance.
+const char kNamedInterfacePrefix[] = "NamedTestingInterface:";
+
+} // namespace automation
+
diff --git a/chrome/common/automation_constants.h b/chrome/common/automation_constants.h
index 13b120e..6579776 100644
--- a/chrome/common/automation_constants.h
+++ b/chrome/common/automation_constants.h
@@ -7,6 +7,7 @@
#pragma once
namespace automation {
+
// JSON value labels for proxy settings that are passed in via
// AutomationMsg_SetProxyConfig. These are here since they are used by both
// AutomationProvider and AutomationProxy.
@@ -16,9 +17,16 @@ extern const char kJSONProxyPacUrl[];
extern const char kJSONProxyBypassList[];
extern const char kJSONProxyServer[];
+// When passing the kTestingChannelID switch to the browser, prepend
+// this prefix to the channel id to enable the named testing interface.
+// Named testing interface is used when you want to connect an
+// AutomationProxy to an already-running browser instance.
+extern const char kNamedInterfacePrefix[];
+
// Amount of time to wait before querying the browser.
static const int kSleepTime = 250;
-}
+
+} // namespace automation
// Used by AutomationProxy, declared here so that other headers don't need
// to include automation_proxy.h.
diff --git a/chrome/common/badge_util.cc b/chrome/common/badge_util.cc
new file mode 100644
index 0000000..bd2067c
--- /dev/null
+++ b/chrome/common/badge_util.cc
@@ -0,0 +1,99 @@
+// 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.
+
+#include "chrome/common/badge_util.h"
+
+#include "app/resource_bundle.h"
+#include "base/utf_string_conversions.h"
+#include "gfx/canvas_skia.h"
+#include "gfx/font.h"
+#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/core/SkTypeface.h"
+
+namespace badge_util {
+
+SkPaint* GetBadgeTextPaintSingleton() {
+#if defined(OS_MACOSX)
+ const char kPreferredTypeface[] = "Helvetica Bold";
+#else
+ const char kPreferredTypeface[] = "Arial";
+#endif
+
+ static SkPaint* text_paint = NULL;
+ if (!text_paint) {
+ text_paint = new SkPaint;
+ text_paint->setAntiAlias(true);
+ text_paint->setTextAlign(SkPaint::kLeft_Align);
+
+ SkTypeface* typeface = SkTypeface::CreateFromName(
+ kPreferredTypeface, SkTypeface::kBold);
+ // Skia doesn't do any font fallback---if the user is missing the font then
+ // typeface will be NULL. If we don't do manual fallback then we'll crash.
+ if (typeface) {
+ text_paint->setFakeBoldText(true);
+ } else {
+ // Fall back to the system font. We don't bold it because we aren't sure
+ // how it will look.
+ // For the most part this code path will only be hit on Linux systems
+ // that don't have Arial.
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
+ typeface = SkTypeface::CreateFromName(
+ WideToUTF8(base_font.GetFontName()).c_str(), SkTypeface::kNormal);
+ }
+
+ text_paint->setTypeface(typeface);
+ // |text_paint| adds its own ref. Release the ref from CreateFontName.
+ typeface->unref();
+ }
+ return text_paint;
+}
+
+SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon,
+ float font_size,
+ const string16& text,
+ const string16& fallback) {
+ const int kMinPadding = 1;
+
+ // Calculate the proper style/text overlay to render on the badge.
+ SkPaint* paint = badge_util::GetBadgeTextPaintSingleton();
+ paint->setTextSize(SkFloatToScalar(font_size));
+ paint->setColor(SK_ColorWHITE);
+
+ std::string badge_text = UTF16ToUTF8(text);
+
+ // See if the text will fit - otherwise use a default.
+ SkScalar text_width = paint->measureText(badge_text.c_str(),
+ badge_text.size());
+
+ if (SkScalarRound(text_width) > (icon.width() - kMinPadding * 2)) {
+ // String is too large - use the alternate text.
+ badge_text = UTF16ToUTF8(fallback);
+ text_width = paint->measureText(badge_text.c_str(), badge_text.size());
+ }
+
+ // When centering the text, we need to make sure there are an equal number
+ // of pixels on each side as otherwise the text looks off-center. So if the
+ // padding would be uneven, clip one pixel off the right side.
+ int badge_width = icon.width();
+ if ((SkScalarRound(text_width) % 1) != (badge_width % 1))
+ badge_width--;
+
+ // Render the badge bitmap and overlay into a canvas.
+ scoped_ptr<gfx::CanvasSkia> canvas(
+ new gfx::CanvasSkia(badge_width, icon.height(), false));
+ canvas->DrawBitmapInt(icon, 0, 0);
+
+ // Draw the text overlay centered horizontally and vertically. Skia expects
+ // us to specify the lower left coordinate of the text box, which is why we
+ // add 'font_size - 1' to the height.
+ SkScalar x = (badge_width - text_width)/2;
+ SkScalar y = (icon.height() - font_size)/2 + font_size - 1;
+ canvas->drawText(badge_text.c_str(), badge_text.size(), x, y, *paint);
+
+ // Return the generated image.
+ return canvas->ExtractBitmap();
+}
+
+} // namespace badge_util
diff --git a/chrome/common/badge_util.h b/chrome/common/badge_util.h
new file mode 100644
index 0000000..57180ef
--- /dev/null
+++ b/chrome/common/badge_util.h
@@ -0,0 +1,32 @@
+// 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 CHROME_COMMON_BADGE_UTIL_H_
+#define CHROME_COMMON_BADGE_UTIL_H_
+#pragma once
+
+#include "base/string16.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
+class SkPaint;
+
+// badge_util provides a set of helper routines for rendering dynamically
+// generated text overlays ("badges") on toolbar icons.
+namespace badge_util {
+
+// Helper routine that returns a singleton SkPaint object configured for
+// rendering badge overlay text (correct font, typeface, etc).
+SkPaint* GetBadgeTextPaintSingleton();
+
+// Given an |icon|, renders the |text| centered on the |icon|. If |text| is
+// too large to fit within the bounds of the image, the |fallback| string is
+// rendered instead (or nothing, if |fallback| is empty).
+SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon,
+ float font_size_in_pixels,
+ const string16& text,
+ const string16& fallback);
+
+} // namespace badge_util;
+
+#endif // CHROME_COMMON_BADGE_UTIL_H_
diff --git a/chrome/common/child_process_info.cc b/chrome/common/child_process_info.cc
index 1af0cdb..8774578 100644
--- a/chrome/common/child_process_info.cc
+++ b/chrome/common/child_process_info.cc
@@ -82,7 +82,7 @@ string16 ChildProcessInfo::GetLocalizedTitle() const {
// to avoid the wrong concatenation result similar to "!Yahoo! Mail: the
// best web-based Email: NIGULP", in which "NIGULP" stands for the Hebrew
// or Arabic word for "plugin".
- base::i18n::AdjustStringForLocaleDirection(title, &title);
+ base::i18n::AdjustStringForLocaleDirection(&title);
switch (type_) {
case ChildProcessInfo::UTILITY_PROCESS:
diff --git a/chrome/common/chrome_paths_internal.h b/chrome/common/chrome_paths_internal.h
index 6671e25..dfe927d 100644
--- a/chrome/common/chrome_paths_internal.h
+++ b/chrome/common/chrome_paths_internal.h
@@ -21,6 +21,15 @@ bool GetDefaultUserDataDirectory(FilePath* result);
// CF and Google Chrome want to share the same binaries.
bool GetChromeFrameUserDataDirectory(FilePath* result);
+// Get the path to the user's cache directory. This is normally the
+// same as the profile directory, but on Linux it can also be
+// $XDG_CACHE_HOME and on Mac it can be under ~/Library/Caches.
+// Note that the Chrome cache directories are actually subdirectories
+// of this directory, with names like "Cache" and "Media Cache".
+// This will always fill in |result| with a directory, sometimes
+// just |profile_dir|.
+void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result);
+
// Get the path to the user's documents directory.
bool GetUserDocumentsDirectory(FilePath* result);
diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc
index 42c6ae7..a7fdb07 100644
--- a/chrome/common/chrome_paths_linux.cc
+++ b/chrome/common/chrome_paths_linux.cc
@@ -6,6 +6,7 @@
#include "base/environment.h"
#include "base/file_util.h"
+#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/nix/xdg_util.h"
@@ -28,6 +29,32 @@ bool GetDefaultUserDataDirectory(FilePath* result) {
return true;
}
+void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) {
+ // See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ // for a spec on where cache files go. Our rule is:
+ // - if the user-data-dir in the standard place,
+ // use same subdirectory of the cache directory.
+ // (this maps ~/.config/google-chrome to ~/.cache/google-chrome as well
+ // as the same thing for ~/.config/chromium)
+ // - otherwise, use the profile dir directly.
+
+ // Default value in cases where any of the following fails.
+ *result = profile_dir;
+
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+
+ FilePath cache_dir;
+ if (!PathService::Get(base::DIR_CACHE, &cache_dir))
+ return;
+ FilePath config_dir(
+ base::nix::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config"));
+
+ if (!config_dir.AppendRelativePath(profile_dir, &cache_dir))
+ return;
+
+ *result = cache_dir;
+}
+
bool GetChromeFrameUserDataDirectory(FilePath* result) {
scoped_ptr<base::Environment> env(base::Environment::Create());
FilePath config_dir(
diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm
index b87b397..57ed3bd 100644
--- a/chrome/common/chrome_paths_mac.mm
+++ b/chrome/common/chrome_paths_mac.mm
@@ -48,6 +48,28 @@ bool GetUserDocumentsDirectory(FilePath* result) {
return mac_util::GetUserDirectory(NSDocumentDirectory, result);
}
+void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) {
+ // If the profile directory is under ~/Library/Application Support,
+ // use a suitable cache directory under ~/Library/Caches. For
+ // example, a profile directory of ~/Library/Application
+ // Support/Google/Chrome/MyProfileName would use the cache directory
+ // ~/Library/Caches/Google/Chrome/MyProfileName.
+
+ // Default value in cases where any of the following fails.
+ *result = profile_dir;
+
+ FilePath app_data_dir;
+ if (!PathService::Get(base::DIR_APP_DATA, &app_data_dir))
+ return;
+ FilePath cache_dir;
+ if (!PathService::Get(base::DIR_CACHE, &cache_dir))
+ return;
+ if (!app_data_dir.AppendRelativePath(profile_dir, &cache_dir))
+ return;
+
+ *result = cache_dir;
+}
+
bool GetUserDownloadsDirectory(FilePath* result) {
return mac_util::GetUserDirectory(NSDownloadsDirectory, result);
}
diff --git a/chrome/common/chrome_paths_unittest.cc b/chrome/common/chrome_paths_unittest.cc
new file mode 100644
index 0000000..23bc7d4
--- /dev/null
+++ b/chrome/common/chrome_paths_unittest.cc
@@ -0,0 +1,44 @@
+// 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.
+
+#include "chrome/common/chrome_paths_internal.h"
+
+#include <stdlib.h>
+
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/path_service.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+// Test the behavior of chrome::GetUserCacheDirectory.
+// See that function's comments for discussion of the subtleties.
+TEST(ChromePaths, UserCacheDir) {
+ FilePath test_profile_dir, cache_dir;
+#if defined(OS_MACOSX)
+ ASSERT_TRUE(PathService::Get(base::DIR_APP_DATA, &test_profile_dir));
+ test_profile_dir = test_profile_dir.Append("foobar");
+ FilePath expected_cache_dir;
+ ASSERT_TRUE(PathService::Get(base::DIR_CACHE, &expected_cache_dir));
+ expected_cache_dir = expected_cache_dir.Append("foobar");
+#elif(OS_POSIX)
+ FilePath homedir = file_util::GetHomeDir();
+ // Note: we assume XDG_CACHE_HOME/XDG_CONFIG_HOME are at their
+ // default settings.
+ test_profile_dir = homedir.Append(".config/foobar");
+ FilePath expected_cache_dir = homedir.Append(".cache/foobar");
+#endif
+
+ // Verify that a profile in the special platform-specific source
+ // location ends up in the special target location.
+#if !defined(OS_WIN) // No special behavior on Windows.
+ chrome::GetUserCacheDirectory(test_profile_dir, &cache_dir);
+ EXPECT_EQ(expected_cache_dir.value(), cache_dir.value());
+#endif
+
+ // Verify that a profile in some other random directory doesn't use
+ // the special cache dir.
+ test_profile_dir = FilePath(FILE_PATH_LITERAL("/some/other/path"));
+ chrome::GetUserCacheDirectory(test_profile_dir, &cache_dir);
+ EXPECT_EQ(test_profile_dir.value(), cache_dir.value());
+}
diff --git a/chrome/common/chrome_paths_win.cc b/chrome/common/chrome_paths_win.cc
index c9fee0f..74a730d 100644
--- a/chrome/common/chrome_paths_win.cc
+++ b/chrome/common/chrome_paths_win.cc
@@ -38,6 +38,11 @@ bool GetChromeFrameUserDataDirectory(FilePath* result) {
return true;
}
+void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) {
+ // This function does more complicated things on Mac/Linux.
+ *result = profile_dir;
+}
+
bool GetUserDocumentsDirectory(FilePath* result) {
wchar_t path_buf[MAX_PATH];
if (FAILED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL,
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 6ba6de8..965c067 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -59,6 +59,8 @@ const char kAppsGalleryReturnTokens[] = "apps-gallery-return-tokens";
// The URL to use for the gallery link in the app launcher.
const char kAppsGalleryURL[] = "apps-gallery-url";
+const char kAppsGalleryUpdateURL[] = "apps-gallery-update-url";
+
// Disable throbber for extension apps.
const char kAppsNoThrob[] = "apps-no-throb";
@@ -157,6 +159,11 @@ const char kDisableAudio[] = "disable-audio";
const char kDisableAuthNegotiateCnameLookup[] =
"disable-auth-negotiate-cname-lookup";
+// Disable background mode (background apps will not keep chrome running in the
+// background). This has priority over the kEnableBackgroundMode flag which is
+// settable via about:labs.
+const char kDisableBackgroundMode[] = "disable-background-mode";
+
// Disable several subsystems which run network requests in the background.
// This is for use when doing network performance testing to avoid noise
// in the measurements.
@@ -322,6 +329,10 @@ const char kDisableSyncPreferences[] = "disable-sync-preferences";
// Disable syncing of themes.
const char kDisableSyncThemes[] = "disable-sync-themes";
+// Enable the new autofill type.
+const char kEnableSyncNewAutofill[] =
+ "enable-sync-new-autofill-data-type";
+
// TabCloseableStateWatcher disallows closing of tabs and browsers under certain
// situations on ChromeOS. Some tests expect tabs or browsers to close, so we
// need a switch to disable the watcher.
@@ -375,6 +386,9 @@ extern const char kLogNetLog[] = "log-net-log";
// Enable gpu-accelerated 2d canvas.
const char kEnableAccelerated2dCanvas[] = "enable-accelerated-2d-canvas";
+// Enables the hardware acceleration of 3D CSS, Video and animation.
+const char kEnableAcceleratedLayers[] = "enable-accelerated-layers";
+
// Enables WebKit accessibility within the renderer process.
const char kEnableAccessibility[] = "enable-accessibility";
@@ -390,12 +404,21 @@ const char kEnableAppLauncher[] = "enable-app-launcher";
const char kEnableAuthNegotiatePort[] = "enable-auth-negotiate-port";
// Enable background mode (background apps will keep chrome running in the
-// background and allow chrome to launch on startup).
+// background and allow chrome to launch on startup). Has no effect on Windows
+// because background mode is enabled there by default.
const char kEnableBackgroundMode[] = "enable-background-mode";
// Enables the benchmarking extensions.
const char kEnableBenchmarking[] = "enable-benchmarking";
+// Enables blocked content warning animation. Currently shows animation for
+// blocked pop-ups only.
+const char kEnableBlockContentAnimation[] = "enable-blocked-content-animation";
+
+// Enable experimental client-side detection of phishing pages.
+const char kEnableClientSidePhishingDetection[] =
+ "enable-client-side-phishing-detection";
+
// This flag enables UI for clearing server data. Temporarily in place
// until there's a server endpoint deployed.
const char kEnableClearServerData[] = "enable-clear-server-data";
@@ -422,6 +445,9 @@ const char kEnableConnectBackupJobs[] = "enable-connect-backup-jobs";
// Link: headers.
const char kEnableContentPrefetch[] = "enable-content-prefetch";
+// Enables web developers to create apps for Chrome without using crx packages.
+const char kEnableCrxlessWebApps[] = "enable-crxless-web-apps";
+
// Whether default apps should be installed in this profile. This flag has no
// effect on Chrome OS because default apps are always enabled there.
const char kEnableDefaultApps[] = "enable-default-apps";
@@ -1309,6 +1335,11 @@ const char kSetToken[] = "set-token";
const char kWebSocketLiveExperimentHost[] = "websocket-live-experiment-host";
#endif
+#if defined(HAVE_XINPUT2)
+const char kTouchDevices[] = "touch-devices";
+#endif
+
+
// USE_SECCOMP_SANDBOX controls whether the seccomp sandbox is opt-in or -out.
// TODO(evan): unify all of these once we turn the seccomp sandbox always
// on. Also remove the #include of command_line.h above.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 2f30352..6b8570d 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -31,6 +31,7 @@ extern const char kApp[];
extern const char kAppId[];
extern const char kAppsGalleryReturnTokens[];
extern const char kAppsGalleryURL[];
+extern const char kAppsGalleryUpdateURL[];
extern const char kAppsNoThrob[];
extern const char kAuthNegotiateDelegateWhitelist[];
extern const char kAuthSchemes[];
@@ -55,6 +56,7 @@ extern const char kDisableAltWinstation[];
extern const char kDisableApplicationCache[];
extern const char kDisableAudio[];
extern const char kDisableAuthNegotiateCnameLookup[];
+extern const char kDisableBackgroundMode[];
extern const char kDisableBackgroundNetworking[];
extern const char kDisableBackingStoreLimit[];
extern const char kDisableConnectBackupJobs[];
@@ -116,12 +118,15 @@ extern const char kDnsServer[];
extern const char kDomAutomationController[];
extern const char kDumpHistogramsOnExit[];
extern const char kEnableAccelerated2dCanvas[];
+extern const char kEnableAcceleratedLayers[];
extern const char kEnableAccessibility[];
extern const char kEnableAeroPeekTabs[];
extern const char kEnableAppLauncher[];
extern const char kEnableAuthNegotiatePort[];
extern const char kEnableBackgroundMode[];
extern const char kEnableBenchmarking[];
+extern const char kEnableBlockContentAnimation[];
+extern const char kEnableClientSidePhishingDetection[];
extern const char kEnableClearServerData[];
extern const char kEnableClickToPlay[];
extern const char kEnableCloudPrintProxy[];
@@ -129,6 +134,7 @@ extern const char kEnableCloudPrint[];
extern const char kEnableConfirmToQuit[];
extern const char kEnableConnectBackupJobs[];
extern const char kEnableContentPrefetch[];
+extern const char kEnableCrxlessWebApps[];
extern const char kEnableDefaultApps[];
extern const char kEnableDeviceMotion[];
extern const char kEnableDNSCertProvenanceChecking[];
@@ -146,6 +152,7 @@ extern const char kEnableNaCl[];
extern const char kEnableNaClDebug[];
extern const char kEnableNativeWebWorkers[];
extern const char kEnablePagePrerender[];
+extern const char kEnableSyncNewAutofill[];
extern const char kEnablePreconnect[];
extern const char kEnablePredictiveInstant[];
extern const char kEnablePreparsedJsCaching[];
@@ -389,6 +396,10 @@ extern const char kWebSocketLiveExperimentHost[];
extern const char kRendererCheckFalseTest[];
#endif
+#if defined(HAVE_XINPUT2)
+extern const char kTouchDevices[];
+#endif
+
#if defined(USE_SECCOMP_SANDBOX)
extern const char kDisableSeccompSandbox[];
#else
diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc
index ca5e90b..165224c 100644
--- a/chrome/common/common_param_traits.cc
+++ b/chrome/common/common_param_traits.cc
@@ -237,6 +237,7 @@ void ParamTraits<WebApplicationInfo>::Write(Message* m,
WriteParam(m, p.icons[i].url);
WriteParam(m, p.icons[i].width);
WriteParam(m, p.icons[i].height);
+ WriteParam(m, p.icons[i].data);
}
}
@@ -255,7 +256,8 @@ bool ParamTraits<WebApplicationInfo>::Read(
result =
ReadParam(m, iter, &icon_info.url) &&
ReadParam(m, iter, &icon_info.width) &&
- ReadParam(m, iter, &icon_info.height);
+ ReadParam(m, iter, &icon_info.height) &&
+ ReadParam(m, iter, &icon_info.data);
if (!result)
return false;
r->icons.push_back(icon_info);
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
index 08235fb..4463a3c 100644
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -115,7 +115,7 @@
{
"type": "string",
"name": "path",
- "description": "A path to a resource within an extension expressed relative to it's install directory."
+ "description": "A path to a resource within an extension expressed relative to its install directory."
}
],
"returns": {
@@ -2342,6 +2342,24 @@
"description": "Pass 'bubble' to give the pop-up window a bubble-chrome border, including an arrow pointing at the relative-to point. Pass 'rectangle' to give the pop-up a rectangular black border with drop-shadow. Default behaviour is to pass 'bubble'.",
"optional": true,
"enum": ["bubble", "rectangle"]
+ },
+ "maxSize": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "width": {
+ "type": "integer",
+ "description": "The maximal width to which the popup will resize. If not present, the popup will be no wider than 800 pixels. The popup will widen to no larger than the minimum of the width parameter and the width of the screen.",
+ "optional": true,
+ "minimum": 32
+ },
+ "height": {
+ "type": "integer",
+ "description": "The maximal height to which the popup will resize. If not present, the popup will be no taller than 600 pixels. The popup will grow to no taller than than the minimum of the height parameter and the width of the screen.",
+ "optional": true,
+ "minimum": 32
+ }
+ }
}
}
},
@@ -2381,7 +2399,7 @@
"nodoc": true,
"types": [
{
- "id": "BookmarkDragDataElement",
+ "id": "BookmarkNodeDataElement",
"nodoc": true,
"type": "object",
"properties": {
@@ -2402,12 +2420,12 @@
},
"children": {
"type": "array",
- "items": {"$ref": "BookmarkDragDataElement"}
+ "items": {"$ref": "BookmarkNodeDataElement"}
}
}
},
{
- "id": "BookmarkDragData",
+ "id": "BookmarkNodeData",
"nodoc": true,
"type": "object",
"description": "Information about the drag and drop data for use with drag and drop events.",
@@ -2415,7 +2433,7 @@
"sameProfile": {"type": "boolean"},
"elements": {
"type": "array",
- "items": {"$ref": "BookmarkDragDataElement"}
+ "items": {"$ref": "BookmarkNodeDataElement"}
}
}
}
@@ -2570,7 +2588,7 @@
"type": "function",
"description": "Fired when dragging bookmarks over the document",
"parameters": [
- {"$ref": "BookmarkDragData"}
+ {"$ref": "BookmarkNodeData"}
]
},
{
@@ -2578,7 +2596,7 @@
"type": "function",
"description": "Fired when the drag and drop leaves the document",
"parameters": [
- {"$ref": "BookmarkDragData"}
+ {"$ref": "BookmarkNodeData"}
]
},
{
@@ -2586,7 +2604,7 @@
"type": "function",
"description": "Fired when the user drops bookmarks on the document",
"parameters": [
- {"$ref": "BookmarkDragData"}
+ {"$ref": "BookmarkNodeData"}
]
}
]
@@ -2867,7 +2885,7 @@
"parentId": {
"type": "integer",
"optional": true,
- "description": "Note: you cannot change an item to be a child of one of it's own descendants."
+ "description": "Note: You cannot change an item to be a child of one of its own descendants."
},
"documentUrlPatterns": {
"type": "array",
@@ -3959,6 +3977,37 @@
]
},
{
+ "name": "setDefaultSuggestion",
+ "type": "function",
+ "description": "Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "suggestion",
+ "description": "A partial SuggestResult object, without the 'content' parameter. See SuggestResult for a description of the parameters.",
+ "properties": {
+ "description": {
+ "type": "string",
+ "minLength": 1,
+ "description": "The text to display in the default suggestion. The placeholder string '%s' can be included and will be replaced with the user's input."
+ },
+ "descriptionStyles": {
+ "type": "array",
+ "optional": true,
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {"type": "string", "enum": ["url", "match", "dim"]},
+ "offset": {"type": "integer"},
+ "length": {"type": "integer", "optional": true}
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ {
"name": "styleUrl",
"type": "function",
"description": "Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of text matching a URL or filename. A negative offset means the region will start at that many characters from the end of the description. If length is omitted, the region will apply for the rest of the description text.",
@@ -4062,6 +4111,10 @@
"description": "The name of this extension or app.",
"type": "string"
},
+ "description": {
+ "description": "The description of this extension or app.",
+ "type": "string"
+ },
"version": {
"description": "The <a href='manifest.html#version'>version</a> of this extension or app.",
"type": "string"
@@ -4081,8 +4134,7 @@
},
"optionsUrl": {
"description": "The url for the item's options page, if it has one.",
- "type": "string",
- "optional": true
+ "type": "string"
},
"icons": {
"description": "A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the <a href='manifest.html#icons'>manifest documentation on icons</a> for more details.",
@@ -4091,6 +4143,20 @@
"items": {
"$ref": "IconInfo"
}
+ },
+ "permissions": {
+ "description": "Returns a list of API based permissions.",
+ "type": "array",
+ "items" : {
+ "type": "string"
+ }
+ },
+ "hostPermissions": {
+ "description": "Returns a list of host based permissions.",
+ "type": "array",
+ "items" : {
+ "type": "string"
+ }
}
}
}
diff --git a/chrome/common/extensions/docs/a11y.html b/chrome/common/extensions/docs/a11y.html
index 21e0c3b..721b93a 100644
--- a/chrome/common/extensions/docs/a11y.html
+++ b/chrome/common/extensions/docs/a11y.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/api_index.html b/chrome/common/extensions/docs/api_index.html
index b3aac33..5480998 100644
--- a/chrome/common/extensions/docs/api_index.html
+++ b/chrome/common/extensions/docs/api_index.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li class="leftNavSelected">chrome.* APIs</li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/api_other.html b/chrome/common/extensions/docs/api_other.html
index aed296a..baa17f2 100644
--- a/chrome/common/extensions/docs/api_other.html
+++ b/chrome/common/extensions/docs/api_other.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li class="leftNavSelected">Other APIs</li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.omnibox.html b/chrome/common/extensions/docs/apps.html
index 69ad86e..0d3b3aa 100644
--- a/chrome/common/extensions/docs/experimental.omnibox.html
+++ b/chrome/common/extensions/docs/apps.html
@@ -16,7 +16,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>
- <title>Experimental.omnibox - Google Chrome Extensions - Google Code</title></head>
+ <title>Packaged Apps - Google Chrome Extensions - Google Code</title></head>
<body> <div id="gc-container" class="labs">
<div id="devModeWarning">
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.
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -240,21 +241,35 @@
<div class="g-unit" id="gc-pagecontent">
<div id="pageTitle">
- <h1 class="page_title">Experimental.omnibox</h1>
+ <h1 class="page_title">Packaged Apps</h1>
</div>
<!-- TABLE OF CONTENTS -->
- <div id="toc" style="display: none; ">
+ <div id="toc">
<h2>Contents</h2>
<ol>
<li>
- <a>h2Name</a>
+ <a href="#overview">Overview</a>
<ol>
- <li>
+ <li style="display: none; ">
+ <a>h3Name</a>
+ </li>
+ </ol>
+ </li><li>
+ <a href="#manifest"> The manifest </a>
+ <ol>
+ <li style="display: none; ">
+ <a>h3Name</a>
+ </li>
+ </ol>
+ </li><li>
+ <a href="#next">What next?</a>
+ <ol>
+ <li style="display: none; ">
<a>h3Name</a>
</li>
</ol>
</li>
- <li>
+ <li style="display: none; ">
<a href="#apiReference">API reference</a>
<ol>
<li>
@@ -301,78 +316,177 @@
</p>
<!-- STATIC CONTENT PLACEHOLDER -->
- <div id="static"><!-- BEGIN AUTHORED CONTENT -->
+ <div id="static"><div id="pageData-name" class="pageData">Packaged Apps</div>
+<div id="pageData-showTOC" class="pageData">true</div>
+
<p>
-The omnibox API allows you to register a
-keyword with Google Chrome's address bar,
-which is also known as the omnibox.
+This page talks about packaged apps—how
+you implement them,
+and how they're different from
+extensions and ordinary web apps.
</p>
+
+<h2 id="overview">Overview</h2>
+
<p>
-<img src="images/omnibox.png" width="480" height="300" alt="A screenshot showing suggestions related to the keyword 'Chromium Search'">
+A packaged app is a web app
+that's bundled into a <code>.crx</code> file
+and can use Chrome extension features.
+You build a packaged app just like you build an extension,
+except that a packaged app can't include a
+<a href="browserAction.html">browser action</a> or
+<a href="pageAction.html">page action</a>.
+Instead, a packaged app includes at least one HTML file
+within its <code>.crx</code> file
+that provides the app's user interface.
</p>
<p>
-When the user enters your extension's
-keyword, the user starts
-interacting solely with your extension.
-Each keystroke is sent to your
-extension, and you can provide suggestions
-in response.
+Packaged apps are a type of
+<a href="http://code.google.com/chrome/apps/">installable web app</a>—a
+web app that can be installed in Chrome.
+The other type of installable web app is a
+<a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted app</a>,
+which is an ordinary web app with a bit of additional metadata.
</p>
<p>
-The suggestions can be richly formatted
-in a variety of ways.
-<!-- PENDING: for example? (include a mention of method name, maybe show a code snippet) -->
-When the user accepts
-a suggestion, your extension is notified
-and can take action.
+If you're developing a web app for the Chrome Web Store,
+you might want to use a packaged app
+instead of a hosted app if any of the following are true:
</p>
-<h2 id="manifest">Manifest</h2>
+<ul>
+ <li>
+ You don't want to run a service to host your app.
+ </li>
+ <li>
+ You want to build an app that works really well offline.
+ </li>
+ <li>
+ You want tighter integration with Chrome,
+ using the extension APIs.
+ </li>
+</ul>
<p>
-To use the omnibox API, your manifest must
-declare the "experimental" permission and
-specify an <code>omnibox_keyword</code> field. You should also
-specify a 16x16-pixel icon, which will be
-displayed in the omnibox when suggesting users
-enter keyword mode.
+The following articles can help you understand
+the differences between web apps and websites,
+extensions and packaged apps, and packaged apps and hosted apps:
</p>
+<ul>
+ <li> <a href="http://code.google.com/chrome/apps/articles/thinking_in_web_apps.html">Thinking in Web Apps</a> </li>
+ <li> <a href="http://codesite-staging:29006/chrome/webstore/articles/apps_vs_extensions.html">Extensions, Packaged Apps, and Hosted Apps in the Chrome Web Store</a> </li>
+</ul>
+
+
+<h2 id="manifest"> The manifest </h2>
+
<p>
-For example:
+A packaged app's manifest can have any field
+that's available to extensions,
+except for "browser_action" and "page_action".
+In addition, a packaged app's manifest <b>must</b>
+have an "app" field.
+Here is a typical manifest for a packaged app:
</p>
<pre>{
- "name": "Aaron's omnibox extension",
- "version": "1.0",
- <b>"permissions": ["experimental"],</b>
- <b>"omnibox_keyword": "aaron",</b>
- <b>"icons": {</b>
- <b>"16": "16-full-color.png"</b>
- <b>},</b>
- "background_page": "background.html"
-}</pre>
-
-<p><b class="note">Note:</b> Google Chrome
-automatically creates a greyscale version of
-your 16x16-pixel icon. You should provide
-a full-color version so that it can also be
-used in other situations that require color.
-For example, the <a href="contextMenus.html">context menus API</a> also uses a 16x16-pixel
-icon, but it is displayed in color.
-
-
-</p><h2 id="examples">Examples</h2>
+ "name": "My Awesome Racing Game",
+ "description": "Enter a world where a Vanagon can beat a Maserati",
+ "version": "1",
+ <b>"app": {
+ "launch": {
+ "local_path": "main.html"
+ }
+ },</b>
+ "icons": {
+ "16": "icon_16.png",
+ "128": "icon_128.png"
+ },
+ "permissions": [
+ "unlimitedStorage",
+ "notifications"
+ ]
+}
+</pre>
<p>
-You can find samples of this API on the
-<a href="samples.html#omnibox">sample page</a>.
+The "app" field has one subfield, "launch",
+which specifies the <em>launch page</em> for the app—the
+page (HTML file bundled into the <code>.crx</code> file)
+that the browser goes to when the user clicks the app's icon
+in the New Tab page.
+The "launch" field can contain the following:
+</p>
+
+<dl>
+ <dt>local_path:</dt>
+ <dd><em>Required.</em>
+ Specifies the launch page
+ as a relative path referring to a file
+ in the <code>.crx</code> package.
+ </dd>
+ <dt>container:</dt>
+ <dd> The value "panel" makes the app appear
+ in an app panel.
+ By default, or when you specify "tab",
+ the app appears in a tab.
+
+ <!-- PENDING: In the overview
+ (or somewhere else before here)
+ we should show and define both app panels and tabs.
+ We should link to that place from here. -->
+ </dd>
+ <dt>height:</dt>
+ <dd>
+ If the container is set to "panel",
+ this integer specifies the height
+ of the panel in pixels.
+ For example, you might specify
+ <code>"height":400</code>.
+ Note that you don't use quotation marks in the value.
+ This field specifies the height of the area
+ to display contents in;
+ window decorations add a few more pixels to the total height.
+ If the container isn't a panel, this field is ignored.
+ </dd>
+ <dt>width:</dt>
+ <dd>
+ Similar to "height",
+ but specifies the width of the panel.
+ </dd>
+
+</dl>
+
+<p>
+Packaged apps usually provide a 16x16 icon
+to be used as the favicon for
+tabs that contain app's pages.
+They also should provide a 128x128 icon,
+but not a 48x48 icon.
+See the manifest documentation for the
+<a href="manifest.html#icons">"icons" field</a>
+for more information.
+</p>
+
+<p>
+For further details on what a packaged app's manifest can contain, see the
+<a href="manifest.html">manifest documentation</a>.
+</p>
+
+<h2 id="next">What next?</h2>
+
+<p>
+Read the <a href="overview.html">Overview</a> to learn
+basic concepts about extensions.
+</p>
+
+<p class="backtotop"><a href="#top">Back to top</a></p>
-<!-- END AUTHORED CONTENT -->
-</p></div>
+</div>
<!-- API PAGE -->
<div class="apiPage" style="display: none; ">
diff --git a/chrome/common/extensions/docs/autoupdate.html b/chrome/common/extensions/docs/autoupdate.html
index 57a70d2..b65e2a8 100644
--- a/chrome/common/extensions/docs/autoupdate.html
+++ b/chrome/common/extensions/docs/autoupdate.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -341,9 +342,9 @@
<p>We want extensions to be autoupdated for some of the same reasons as Google Chrome itself: to incorporate bug and security fixes, add new features or performance enhancements, and improve user interfaces.</p>
-<p>If you distribute your extension using the <a href="https://chrome.google.com/extensions">gallery</a>, you can <em>ignore this page</em>. You can use a web interface to release updated versions of your extension.</p>
+<p>If you publish your extension using the <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>, you can <em>ignore this page</em>. You can use the dashboard to release updated versions of your extension to users, as well as to the Extensions Gallery or Chrome Web Store.</p>
-<p>If you want to host your extension somewhere other than the gallery, keep reading.
+<p>If you want to host your extension somewhere other than the gallery or store, keep reading.
You should also read <a href="hosting.html">Hosting</a> and
<a href="packaging.html">Packaging</a>.</p>
diff --git a/chrome/common/extensions/docs/background_pages.html b/chrome/common/extensions/docs/background_pages.html
index b1029a1..68dfa2d 100644
--- a/chrome/common/extensions/docs/background_pages.html
+++ b/chrome/common/extensions/docs/background_pages.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/bookmarks.html b/chrome/common/extensions/docs/bookmarks.html
index 20a1084..1f31c7b 100644
--- a/chrome/common/extensions/docs/bookmarks.html
+++ b/chrome/common/extensions/docs/bookmarks.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/browserAction.html b/chrome/common/extensions/docs/browserAction.html
index b9827ea..639fd88 100644
--- a/chrome/common/extensions/docs/browserAction.html
+++ b/chrome/common/extensions/docs/browserAction.html
@@ -166,10 +166,10 @@
<li class="leftNavSelected">Browser Actions</li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -365,6 +366,11 @@ use a <a href="pageAction.html">page action</a>
instead of a browser action.
</p>
+<p class="caution">
+<strong>Note:</strong>
+Packaged apps cannot use browser actions.
+</p>
+
<!-- [PENDING: We should show tooltips and badges, as well.] -->
<h2 id="manifest">Manifest</h2>
diff --git a/chrome/common/extensions/docs/content_scripts.html b/chrome/common/extensions/docs/content_scripts.html
index 407ae71..3e529d2 100644
--- a/chrome/common/extensions/docs/content_scripts.html
+++ b/chrome/common/extensions/docs/content_scripts.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/contextMenus.html b/chrome/common/extensions/docs/contextMenus.html
index 4e9833a..1265b34 100644
--- a/chrome/common/extensions/docs/contextMenus.html
+++ b/chrome/common/extensions/docs/contextMenus.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li class="leftNavSelected">Context Menus</li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -2006,7 +2007,7 @@ You can find samples of this API on the
<dd class="todo" style="display: none; ">
Undocumented.
</dd>
- <dd>Note: you cannot change an item to be a child of one of it's own descendants.</dd>
+ <dd>Note: You cannot change an item to be a child of one of its own descendants.</dd>
<dd style="display: none; ">
This parameter was added in version
<b><span></span></b>.
diff --git a/chrome/common/extensions/docs/cookies.html b/chrome/common/extensions/docs/cookies.html
index 8fcc978..582afa1 100644
--- a/chrome/common/extensions/docs/cookies.html
+++ b/chrome/common/extensions/docs/cookies.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/crx.html b/chrome/common/extensions/docs/crx.html
index 92e395f..b1b2df7 100644
--- a/chrome/common/extensions/docs/crx.html
+++ b/chrome/common/extensions/docs/crx.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/devguide.html b/chrome/common/extensions/docs/devguide.html
index 0ea612b..a806b4b 100644
--- a/chrome/common/extensions/docs/devguide.html
+++ b/chrome/common/extensions/docs/devguide.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -307,6 +308,8 @@
These pages assume you've completed
the <a href="getstarted.html">Getting Started</a> tutorial
and <a href="overview.html">Overview</a>.
+Unless otherwise stated, everything in this page
+applies to packaged apps, as well as extensions.
</p>
<table class="columns">
@@ -318,13 +321,17 @@ and <a href="overview.html">Overview</a>.
</tr>
<tr>
<td> <a href="browserAction.html">Browser&nbsp;Actions</a> </td>
- <td> Add icons to the toolbar </td>
+ <td> Add icons to the toolbar <em>(extensions only)</em> </td>
</tr>
<tr>
<td> <a href="notifications.html">Desktop&nbsp;Notifications</a> </td>
<td> Notify users of important events </td>
</tr>
<tr>
+ <td> <a href="omnibox.html">Omnibox</a> </td>
+ <td> Add a keyword to the address bar </td>
+ </tr>
+ <tr>
<td> <a href="options.html">Options&nbsp;Pages</a> </td>
<td> Let users customize your extension </td>
</tr>
@@ -335,7 +342,7 @@ and <a href="overview.html">Overview</a>.
</tr>
<tr>
<td> <a href="pageAction.html">Page&nbsp;Actions</a> </td>
- <td> Add temporary icons inside the address bar </td>
+ <td> Add temporary icons inside the address bar <em>(extensions only)</em> </td>
</tr>
<tr>
<td> <a href="themes.html">Themes</a> </td>
@@ -421,7 +428,7 @@ and <a href="overview.html">Overview</a>.
</tr>
<tr>
<td> <a href="hosting.html">Hosting</a> </td>
- <td> Host extensions in the Extensions Gallery or on your own servers </td>
+ <td> Host extensions on Google servers or your own </td>
</tr>
<tr>
<td> <a href="external_extensions.html">Other Deployment Options</a> </td>
diff --git a/chrome/common/extensions/docs/docs.html b/chrome/common/extensions/docs/docs.html
index 81ff7a0..aa629a7 100644
--- a/chrome/common/extensions/docs/docs.html
+++ b/chrome/common/extensions/docs/docs.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -304,16 +305,26 @@
<div id="static"><div id="pageData-name" class="pageData">Hello There!</div>
<p>
-This documentation tells you how to write <em>Google Chrome Extensions</em> —
-small software programs
-that can modify and enhance the functionality of the
+This documentation tells you how to write extensions
+and packaged apps for the
<a href="http://www.google.com/chrome">Google Chrome browser</a>.
+Because extensions came first,
+the APIs and these docs say <em>extension</em> everywhere,
+even though almost everything applies to packaged apps, as well.
</p>
+<p class="caution">
+<b>Note:</b>
+Unless you see a note
+describing an exception for packaged apps,
+everything in this documentation applies to both extensions and packaged apps.
+</p>
+
+
<h2 id="readme"> Where to start </h2>
<p>
-Before you write an extension,
+Before you code,
read these:
</p>
@@ -340,10 +351,11 @@ Also check out these:
<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">Group: chromium-extensions</a>
</li>
<li>
- <a href="http://code.google.com/chrome/extensions/index.html">Home: Google Chrome Extensions</a>
+ <a href="http://chrome.google.com/webstore">Chrome Web Store</a>
</li>
<li>
- <a href="https://chrome.google.com/extensions">Gallery</a>
+ <a href="http://code.google.com/chrome/webstore/">Chrome Web Store
+ developer documentation</a>
</li>
</ul>
diff --git a/chrome/common/extensions/docs/events.html b/chrome/common/extensions/docs/events.html
index c00cc03..e6a3bb2 100644
--- a/chrome/common/extensions/docs/events.html
+++ b/chrome/common/extensions/docs/events.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/examples/extensions/chrome_search/background.html b/chrome/common/extensions/docs/examples/extensions/chrome_search/background.html
index ca50d9b..07f9740 100644
--- a/chrome/common/extensions/docs/examples/extensions/chrome_search/background.html
+++ b/chrome/common/extensions/docs/examples/extensions/chrome_search/background.html
@@ -13,6 +13,11 @@ chrome.omnibox.onInputChanged.addListener(
currentRequest = null;
}
+ updateDefaultSuggestion(text);
+
+ if (text == 'halp')
+ return;
+
currentRequest = search(text, function(xml) {
var results = [];
var entries = xml.getElementsByTagName("entry");
@@ -23,30 +28,34 @@ chrome.omnibox.onInputChanged.addListener(
entry.getElementsByTagName("match")[0].getAttribute("lineNumber");
var file = path.split("/").pop();
- // Remove HTML tags from description since omnibox cannot display them.
- var description = entry.getElementsByTagName("content")[0].textContent;
- description = description.replace(/<\/?.+?>/g, '');
- description = file + ': ' + description;
- descriptionStyles = [
- chrome.omnibox.styleUrl(0, file.length),
- ]
-
- // Highlight all occurrences of the match text.
- var index = -1;
- for (;;) {
- var index = description.indexOf(text, index+1);
- if (index < 0) break;
- if (index > file.length) {
- descriptionStyles.push(
- chrome.omnibox.styleMatch(index, text.length)
- );
+ var description = '<url>' + file + '</url>';
+ if (/^file:/.test(text)) {
+ description += ' <dim>' + path + '</dim>';
+ } else {
+ description += ' ';
+
+ // Highlight all occurrences of the match text.
+ var content = entry.getElementsByTagName("content")[0].textContent;
+ var start = 0;
+ var index = 0;
+ for (;;) {
+ var index = content.toLowerCase().indexOf(
+ text.toLowerCase(), start);
+ if (index < 0) {
+ description += content.substring(start);
+ break;
+ }
+
+ description += content.substring(start, index);
+ description +=
+ '<match>' + content.substr(index, text.length) + '</match>';
+ start = index + text.length;
}
}
results.push({
content: path + '@' + line,
- description: description,
- descriptionStyles: descriptionStyles,
+ description: description
});
}
@@ -55,9 +64,58 @@ chrome.omnibox.onInputChanged.addListener(
}
);
+function resetDefaultSuggestion() {
+ chrome.omnibox.setDefaultSuggestion({
+ description: '<url><match>src:</match></url> Search Chromium source'
+ });
+}
+
+resetDefaultSuggestion();
+
+function updateDefaultSuggestion(text) {
+ var isRegex = /^re:/.test(text);
+ var isFile = /^file:/.test(text);
+ var isHalp = (text == 'halp');
+ var isPlaintext = text.length && !isRegex && !isFile && !isHalp;
+
+ var description = '<match><url>src</url></match><dim> [</dim>';
+ description +=
+ isPlaintext ? ('<match>' + text + '</match>') : 'plaintext-search';
+ description += '<dim> | </dim>';
+ description += isRegex ? ('<match>' + text + '</match>') : 're:regex-search';
+ description += '<dim> | </dim>';
+ description += isFile ? ('<match>' + text + '</match>') : 'file:filename';
+ description += '<dim> | </dim>';
+ description += isHalp ? '<match>halp</match>' : 'halp';
+ description += '<dim> ]</dim>';
+
+ chrome.omnibox.setDefaultSuggestion({
+ description: description
+ });
+}
+
+chrome.omnibox.onInputStarted.addListener(function() {
+ updateDefaultSuggestion('');
+});
+
+chrome.omnibox.onInputCancelled.addListener(function() {
+ resetDefaultSuggestion();
+});
+
function search(query, callback) {
+ if (query == 'halp')
+ return;
+
+ if (/^re:/.test(query))
+ query = query.substring('re:'.length);
+ else if (/^file:/.test(query))
+ query = 'file:"' + query.substring('file:'.length) + '"';
+ else
+ query = '"' + query + '"';
+
var url = "http://www.google.com/codesearch/feeds/search?" +
- "q=package:chromium.git+" + query;
+ "q=package:src.chromium.org/git/chromium.git+" + query;
+
var req = new XMLHttpRequest();
req.open("GET", url, true);
req.setRequestHeader("GData-Version", "2");
@@ -71,9 +129,9 @@ function search(query, callback) {
}
function getUrl(path, line) {
- var url =
- "http://src.chromium.org/cgi-bin/gitweb.cgi?p=chromium.git;a=blob;hb=HEAD;f=" +
- path + "#l" + line;
+ var url = "http://www.google.com/codesearch/p#hfE6470xZHk/" + path;
+ if (line)
+ url += "&l=" + line;
return url;
}
@@ -90,18 +148,19 @@ function navigate(url) {
});
}
-chrome.omnibox.onInputEntered.addListener(
- function(text) {
- if (text.indexOf('@') > 0) {
- var chunks = text.split('@');
- var path = chunks[0];
- var line = chunks[1];
- navigate(getUrl(path, line));
- } else {
- search(text, function(xml) {
- navigate(getEntryUrl(xml.getElementsByTagName("entry")[0]));
- });
- }
+chrome.omnibox.onInputEntered.addListener(function(text) {
+ // TODO(aa): We need a way to pass arbitrary data through. Maybe that is just
+ // URL?
+ if (/@\d+\b/.test(text)) {
+ var chunks = text.split('@');
+ var path = chunks[0];
+ var line = chunks[1];
+ navigate(getUrl(path, line));
+ } else if (text == 'halp') {
+ // TODO(aa)
+ } else {
+ navigate("http://codesearch.google.com/codesearch?q=" +
+ "package:src.chromium.org/git/chromium.git " + text);
}
-);
+});
</script>
diff --git a/chrome/common/extensions/docs/experimental.clipboard.html b/chrome/common/extensions/docs/experimental.clipboard.html
index b54b3ba..4852c75 100644
--- a/chrome/common/extensions/docs/experimental.clipboard.html
+++ b/chrome/common/extensions/docs/experimental.clipboard.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.contextMenus.html b/chrome/common/extensions/docs/experimental.contextMenus.html
index d709193..5f246fd 100644
--- a/chrome/common/extensions/docs/experimental.contextMenus.html
+++ b/chrome/common/extensions/docs/experimental.contextMenus.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.cookies.html b/chrome/common/extensions/docs/experimental.cookies.html
index 48e25ae..b179e08 100644
--- a/chrome/common/extensions/docs/experimental.cookies.html
+++ b/chrome/common/extensions/docs/experimental.cookies.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.history.html b/chrome/common/extensions/docs/experimental.history.html
index 498667c..b839162 100644
--- a/chrome/common/extensions/docs/experimental.history.html
+++ b/chrome/common/extensions/docs/experimental.history.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.html b/chrome/common/extensions/docs/experimental.html
index 6fec780..fd600a2 100644
--- a/chrome/common/extensions/docs/experimental.html
+++ b/chrome/common/extensions/docs/experimental.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -319,12 +320,12 @@ on the following experimental APIs:
<a href="experimental.webRequest.html">experimental.webRequest</a></li>
</ul>
-<p class="caution">
+<p class="warning">
<b>Caution:</b>
Don't depend on these experimental APIs.
They might disappear,
and they <em>will</em> change.
-Also, the extension gallery doesn't allow you to
+Also, the Chrome Developer Dashboard doesn't allow you to
upload extensions that use experimental APIs.
</p>
diff --git a/chrome/common/extensions/docs/experimental.idle.html b/chrome/common/extensions/docs/experimental.idle.html
index 58e0b9d..6f709ae 100644
--- a/chrome/common/extensions/docs/experimental.idle.html
+++ b/chrome/common/extensions/docs/experimental.idle.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.infobars.html b/chrome/common/extensions/docs/experimental.infobars.html
index 4a76122..59e642d 100644
--- a/chrome/common/extensions/docs/experimental.infobars.html
+++ b/chrome/common/extensions/docs/experimental.infobars.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.processes.html b/chrome/common/extensions/docs/experimental.processes.html
index 06997aa..a41a1c6 100644
--- a/chrome/common/extensions/docs/experimental.processes.html
+++ b/chrome/common/extensions/docs/experimental.processes.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.proxy.html b/chrome/common/extensions/docs/experimental.proxy.html
index 08eb220..3f97065 100644
--- a/chrome/common/extensions/docs/experimental.proxy.html
+++ b/chrome/common/extensions/docs/experimental.proxy.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.sidebar.html b/chrome/common/extensions/docs/experimental.sidebar.html
index 45d5f59..09e6819 100644
--- a/chrome/common/extensions/docs/experimental.sidebar.html
+++ b/chrome/common/extensions/docs/experimental.sidebar.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -951,7 +952,7 @@
<dd class="todo" style="display: none; ">
Undocumented.
</dd>
- <dd>'hidden' indicates sidebar is not defined for the specified tab (show was never called or hide() was called). Nothing is displayed for this sidebar.<br>'shown' means sidebar is defined for the specified tab; mini tab is displayed for this sidebar. Sidebar UI is either collapsed or displaying a content of some other extension's sidebar.<br>'active' indicates that sidebar is defined for the specified tab; sidebar UI is expanded and displaying this sidebar's content.</dd>
+ <dd>'hidden' indicates sidebar is not defined for the specified tab (show was never called or hide() was called). Nothing is displayed for this sidebar.'shown' means sidebar is defined for the specified tab; mini tab is displayed for this sidebar. Sidebar UI is either collapsed or displaying a content of some other extension's sidebar.'active' indicates that sidebar is defined for the specified tab; sidebar UI is expanded and displaying this sidebar's content.</dd>
<dd style="display: none; ">
This parameter was added in version
<b><span></span></b>.
diff --git a/chrome/common/extensions/docs/experimental.webNavigation.html b/chrome/common/extensions/docs/experimental.webNavigation.html
index 4d40227..237ee23 100644
--- a/chrome/common/extensions/docs/experimental.webNavigation.html
+++ b/chrome/common/extensions/docs/experimental.webNavigation.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/experimental.webRequest.html b/chrome/common/extensions/docs/experimental.webRequest.html
index 8f2c52f..14346ff 100644
--- a/chrome/common/extensions/docs/experimental.webRequest.html
+++ b/chrome/common/extensions/docs/experimental.webRequest.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/extension.html b/chrome/common/extensions/docs/extension.html
index dc5beda..e7bb9e7 100644
--- a/chrome/common/extensions/docs/extension.html
+++ b/chrome/common/extensions/docs/extension.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -1224,7 +1225,7 @@ For details, see
<dd class="todo" style="display: none; ">
Undocumented.
</dd>
- <dd>A path to a resource within an extension expressed relative to it's install directory.</dd>
+ <dd>A path to a resource within an extension expressed relative to its install directory.</dd>
<dd style="display: none; ">
This parameter was added in version
<b><span></span></b>.
diff --git a/chrome/common/extensions/docs/external_extensions.html b/chrome/common/extensions/docs/external_extensions.html
index fb9dcab..39c1540 100644
--- a/chrome/common/extensions/docs/external_extensions.html
+++ b/chrome/common/extensions/docs/external_extensions.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/faq.html b/chrome/common/extensions/docs/faq.html
index 5e0617b..66cc1b4 100644
--- a/chrome/common/extensions/docs/faq.html
+++ b/chrome/common/extensions/docs/faq.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -309,33 +310,35 @@
<p>
If you don't find an answer to your question here,
try the
-<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">group</a> or the
+<a href="http://code.google.com/chrome/webstore/faq.html">Chrome Web Store FAQ</a>, the
+<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">group</a>, or the
<a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">gallery help</a>.
+<!-- PENDING: add a link to store help -->
</p>
<div id="faq-TOC">
<h4>General</h4>
<ul>
<li><a href="#faq-gen-01">What are Google Chrome Extensions?</a></li>
- <li><a href="#faq-gen-02">What technologies are used to write extensions for Google Chrome?</a></li>
+ <li><a href="#faq-gen-02">What technologies are used to write extensions for Chrome?</a></li>
<li><a href="#faq-gen-03">Are extensions fetched from the web every time the browser is loaded?</a></li>
</ul>
<h4>Development</h4>
<ul>
- <li><a href="#faq-dev-01">How can I set up Google Chrome for extension development?</a></li>
+ <li><a href="#faq-dev-01">How can I set up Chrome for extension development?</a></li>
<li><a href="#faq-dev-02">Can I make cross-domain Ajax requests in an extension?</a></li>
<li><a href="#faq-dev-03">Can I use 3rd party web services in my extension?</a></li>
<li><a href="#faq-dev-04">Can I use OAuth in my extensions?</a></li>
<li><a href="#faq-dev-05">What UI controls can I create for my extension?</a></li>
<li><a href="#faq-dev-06">Can I load DLLs in my extension?</a></li>
- <li><a href="#faq-dev-07">Can Google Chrome Extensions encode/decode JSON data?</a></li>
+ <li><a href="#faq-dev-07">Can extensions encode/decode JSON data?</a></li>
<li><a href="#faq-dev-08">Can I store data locally in my extension?</a></li>
<li><a href="#faq-dev-09">How much data can I store in localStorage?</a></li>
<li><a href="#faq-dev-10">Can I create an options menu for my application?</a></li>
<li><a href="#faq-dev-11">Can two extensions communicate with each other?</a></li>
<li><a href="#faq-dev-12">What debugging tools are available to extension developers?</a></li>
<li><a href="#faq-dev-13">Can extensions use Google Analytics?</a></li>
- <li><a href="#faq-dev-14">How do I determine which version of Google Chrome is deployed to which channel?</a></li>
+ <li><a href="#faq-dev-14">How do I determine which version of Chrome is deployed to which channel?</a></li>
<li><a href="#faq-dev-15">Can I add a content script to chrome:// URLs?</a></li>
<li><a href="#faq-dev-16">Why do wildcard matches not work for top level domains (TLDs)?</a></li>
</ul>
@@ -350,17 +353,17 @@ try the
<h3 id="faq-gen-01">What are Google Chrome Extensions?</h3>
<p>
- Google Chrome Extensions are applications that run inside the Google
+ Google Chrome Extensions are applications that run inside the
Chrome browser and provide additional functionality, integration with third
party websites or services, and customized browsing experiences.
</p>
-<h3 id="faq-gen-02">What technologies are used to write extensions for Google Chrome?</h3>
+<h3 id="faq-gen-02">What technologies are used to write extensions for Chrome?</h3>
<p>
- Google Chrome Extensions are written using the same standard web
+ Extensions are written using the same standard web
technologies that developers use to create websites. HTML is used as a
content markup language, CSS is used for styling, and JavaScript for
- scripting. Because Google Chrome supports HTML5 and CSS3, developers can
+ scripting. Because Chrome supports HTML5 and CSS3, developers can
use the latest open web technologies such as canvas and CSS animations in
their extensions. Extensions also have access to several
<a href="http://code.google.com/chrome/extensions/api_other.html">JavaScript APIs</a>
@@ -371,7 +374,7 @@ try the
<h3 id="faq-gen-03">Are extensions fetched from the web every time the browser is loaded?</h3>
<p>
- Extensions are downloaded by the Google Chrome browser upon install, and
+ Extensions are downloaded by the Chrome browser upon install, and
are subsequently run off of the local disk in order to speed up
performance. However, if a new version of the extension is pushed online,
it will be automatically downloaded in the background to any users who
@@ -384,9 +387,9 @@ try the
<h2>Development</h2>
-<h3 id="faq-dev-01">How can I set up Google Chrome for extension development?</h3>
+<h3 id="faq-dev-01">How can I set up Chrome for extension development?</h3>
<p>
- As long as you are using a version of Google Chrome that supports
+ As long as you are using a version of Chrome that supports
extensions, you already have everything you need to start writing an
extension of your own.
You can start by turning on Developer mode.
@@ -395,8 +398,7 @@ try the
<p>
Click the wrench icon
<img src="images/toolsmenu.gif" height="29" width="29" alt="" class="nomargin">
- and select <b>Extensions</b> from the <b>Tools</b> menu
- (or from the <b>Window</b> menu on Mac).
+ and select <b>Extensions</b> from the <b>Tools</b> menu.
If there's a "+" next to "Developer mode",
click the "+" so it turns into a "-".
Now you can reload extensions,
@@ -414,14 +416,14 @@ try the
<h3 id="faq-dev-03">Can I use 3rd party web services in my extension?</h3>
<p>
- Yes. Google Chrome Extensions are capable of making cross-domain Ajax
- requests, so they can call remote APIs directly. APIs which provide data
+ Yes. Extensions are capable of making cross-domain Ajax
+ requests, so they can call remote APIs directly. APIs that provide data
in JSON format are particularly easy to use.
</p>
<h3 id="faq-dev-04">Can I use OAuth in my extensions?</h3>
<p>
- Absolutely, there are extensions which use OAuth to access remote data
+ Absolutely, there are extensions that use OAuth to access remote data
APIs. Most developers find it convenient to use a
<a href="http://unitedheroes.net/OAuthSimple/js/OAuthSimple.js">JavaScript OAuth library</a>
in order to simplify the process of signing OAuth requests.
@@ -432,7 +434,7 @@ try the
Extensions use HTML and CSS to define their user interfaces, so you can use
standard form controls to build your UI, or style the interface with CSS,
as you would a web page. Additionally, your extension may add buttons
- to the Google Chrome browser itself. See
+ to the Chrome browser itself. See
<a href="http://code.google.com/chrome/extensions/browserAction.html">browser actions</a>
and
<a href="http://code.google.com/chrome/extensions/pageAction.html">page actions</a>
@@ -444,12 +446,13 @@ try the
Yes, using the
<a href="http://code.google.com/chrome/extensions/trunk/npapi.html">NPAPI interface</a>.
Because of the possibility for abuse, though, we will review your extension
- before hosting it in the Google Chrome Extensions Gallery.
+ before hosting it in the Google Chrome Extensions Gallery
+ or Chrome Web Store.
</p>
-<h3 id="faq-dev-07">Can Google Chrome Extensions encode/decode JSON data?</h3>
+<h3 id="faq-dev-07">Can extensions encode/decode JSON data?</h3>
<p>
- Yes, because V8 (Google Chrome's JavaScript engine) supports
+ Yes, because V8 (Chrome's JavaScript engine) supports
JSON.stringify and JSON.parse natively, you may use these functions in your
extensions
<a href="http://json.org/js.html">as described here</a> without including
@@ -459,11 +462,11 @@ try the
<h3 id="faq-dev-08">Can I store data locally in my extension?</h3>
<p>
Yes, extensions can use <a href="http://dev.w3.org/html5/webstorage/">localStorage</a>
- to store string data permanently. Using Google Chrome's built-in JSON
+ to store string data permanently. Using Chrome's built-in JSON
functions, you can store complex data structures in localStorage. For
- extensions which have the need to execute SQL queries on their stored data,
- Google Chrome implements
- <a href="http://dev.w3.org/html5/webdatabase/">client side SQL databases</a>
+ extensions that need to execute SQL queries on their stored data,
+ Chrome implements
+ <a href="http://dev.w3.org/html5/webdatabase/">client side SQL databases</a>,
which may be used as well.
</p>
@@ -475,7 +478,7 @@ try the
<h3 id="faq-dev-10">Can I create an options menu for my application?</h3>
<p>
You can let users set options for your extension by creating an
- <a href="http://code.google.com/chrome/extensions/trunk/options.html">options page</a>
+ <a href="http://code.google.com/chrome/extensions/trunk/options.html">options page</a>,
which is a simple HTML page that will be loaded when a user clicks the
"options" button for your extension. This page can read and write settings
to localStorage, or even send options to a web server so that they can be
@@ -491,7 +494,7 @@ try the
<h3 id="faq-dev-12">What debugging tools are available to extension developers?</h3>
<p>
- Google Chrome's built-in developer tools can be used to debug extensions
+ Chrome's built-in developer tools can be used to debug extensions
as well as web pages. See this
<a href="http://code.google.com/chrome/extensions/tut_debugging.html ">tutorial on debugging extensions</a>
for more information.
@@ -507,9 +510,9 @@ try the
this.
</p>
-<h3 id="faq-dev-14">How do I determine which version of Google Chrome is deployed to which channel?</h3>
+<h3 id="faq-dev-14">How do I determine which version of Chrome is deployed to which channel?</h3>
<p>
- To determine which version of Google Chrome is currently available on each
+ To determine which version of Chrome is currently available on each
of the different platforms, visit
<a href="http://omahaproxy.appspot.com">omahaproxy.appspot.com</a>. On that
site you will see data in a format similar to:
@@ -535,7 +538,7 @@ win,stable,#.#.###.#,#.#.###.#</pre>
channels are <code>canary</code>, <code>dev</code>, <code>beta</code>,
and <code>stable</code>.
The two four-part numbers at the end of each line represent the range of
- versions of Google Chrome currently deployed to that platform-channel
+ versions of Chrome currently deployed to that platform-channel
combination.
</p>
@@ -591,7 +594,7 @@ win,stable,#.#.###.#,#.#.###.#</pre>
<p>
While developing an extension, you may find behavior that does not
match the extensions documentation and may be the result of a bug in
- Google Chrome. The best thing to do is to make sure an appropriate issue
+ Chrome. The best thing to do is to make sure an appropriate issue
report is filed, and the Chromium team has enough information to reproduce
the behavior.
</p>
@@ -614,8 +617,8 @@ win,stable,#.#.###.#,#.#.###.#</pre>
extensions are filed under <strong>Feature=Extensions</strong>, so to
look for an extension bug related to the
chrome.tabs.executeScript function (for example), search for
- "<code>Feature=Extensions Type=Bug chrome.tabs.executeScript</code>" which
- will give you
+ "<code>Feature=Extensions Type=Bug chrome.tabs.executeScript</code>",
+ which will give you
<a href="http://code.google.com/p/chromium/issues/list?can=2&amp;q=Feature%3DExtensions+Type%3DBug+chrome.tabs.executeScript&amp;colspec=ID+Stars+Pri+Area+Feature+Type+Status+Summary+Modified+Owner+Mstone+OS&amp;x=mstone&amp;y=area&amp;cells=tiles">
this list of results</a>.
</li>
@@ -669,8 +672,8 @@ win,stable,#.#.###.#,#.#.###.#</pre>
extensions are filed under <strong>Feature=Extensions</strong>, so to
look for an extension feature request related to keyboard shortcuts
(for example), search
- for "<code>Feature=Extensions Type=Feature shortcuts</code>" which will
- give you
+ for "<code>Feature=Extensions Type=Feature shortcuts</code>",
+ which will give you
<a href="http://code.google.com/p/chromium/issues/list?can=2&amp;q=Feature%3DExtensions+Type%3DFeature+shortcuts&amp;colspec=ID+Stars+Pri+Area+Feature+Type+Status+Summary+Modified+Owner+Mstone+OS&amp;x=mstone&amp;y=area&amp;cells=tiles">
this list of results</a>.
</li>
diff --git a/chrome/common/extensions/docs/getstarted.html b/chrome/common/extensions/docs/getstarted.html
index b8fc043..d7e94c8 100644
--- a/chrome/common/extensions/docs/getstarted.html
+++ b/chrome/common/extensions/docs/getstarted.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -466,8 +467,7 @@ Here are some suggestions for what to read next:
</li>
<li>
The <a href="hosting.html">hosting</a> page,
- which tells you about the gallery
- and other options for distributing your extension
+ which tells you about options for distributing your extension
</li>
</ul>
diff --git a/chrome/common/extensions/docs/history.html b/chrome/common/extensions/docs/history.html
index ebcfa6d..ce1c49e 100644
--- a/chrome/common/extensions/docs/history.html
+++ b/chrome/common/extensions/docs/history.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/hosting.html b/chrome/common/extensions/docs/hosting.html
index 19ccde8..e852619 100644
--- a/chrome/common/extensions/docs/hosting.html
+++ b/chrome/common/extensions/docs/hosting.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -243,25 +244,18 @@
<h1 class="page_title">Hosting</h1>
</div>
<!-- TABLE OF CONTENTS -->
- <div id="toc">
+ <div id="toc" style="display: none; ">
<h2>Contents</h2>
<ol>
<li>
- <a href="#gallery">Publishing to the Extensions Gallery</a>
+ <a>h2Name</a>
<ol>
- <li style="display: none; ">
- <a>h3Name</a>
- </li>
- </ol>
- </li><li>
- <a href="#server">Hosting on your own server</a>
- <ol>
- <li style="display: none; ">
+ <li>
<a>h3Name</a>
</li>
</ol>
</li>
- <li style="display: none; ">
+ <li>
<a href="#apiReference">API reference</a>
<ol>
<li>
@@ -309,124 +303,53 @@
<!-- STATIC CONTENT PLACEHOLDER -->
<div id="static"><div id="pageData-name" class="pageData">Hosting</div>
-<div id="pageData-showTOC" class="pageData">true</div>
-
-<p>
-Until the
-<a href="http://code.google.com/chrome/webstore/">Chrome Web Store</a>
-is available to the public,
-you can host your extension
-using the <a href="https://chrome.google.com/extensions">Extensions Gallery</a>.
-Once the store is public,
-the gallery's contents will be merged into the store.
-Another option
-is hosting your extension on other servers.
-</p>
<p>
-This page gives tips for using the gallery,
-as well as details on how to host extensions on your own server.
-</p>
-
-<h2 id="gallery">Publishing to the Extensions Gallery</h2>
-
-<p>
-To publish extensions,
-you first need to pay a one-time
-<a href="http://blog.chromium.org/2010/08/security-improvements-and-registration.html">$5 developer registration fee</a>.
+This page tells you how to host <code>.crx</code> files
+on your own server.
+If you distribute your extension, app, or theme solely through the
+<a href="http://chrome.google.com/webstore">Chrome Web Store</a>,
+you don't need this page.
+Instead, consult the store help and
+<a href="http://code.google.com/chrome/webstore/index.html">developer documentation</a>.
+<!-- PENDING: add a link to the help -->
</p>
<p class="note">
-<b>Note:</b>
-If you used the Chrome Developer Dashboard before
-the first developer preview release of the Chrome Web Store —
-to publish an extension, for example —
-you don't need to pay the fee.
-</p>
-
-<p>
-Publishing to the gallery is easy,
-but your extension might be more popular
-if you take a little time to prepare:
-</p>
-
-<ul>
- <li> Visit the
- <a href="https://chrome.google.com/extensions">gallery</a>
- and look at similar extensions' pages.
- Your extension's page should look at least as good as theirs. </li>
- <li> Consider creating a support site for your extension,
- maybe a <a href="http://groups.google.com">Google Group</a>.
- If your extension's page has a link to your support site,
- people will be less likely to
- complain in the user comments. </li>
- <li> Consider creating a custom Gmail account
- for this extension or for all of your extensions.
- Only one account can upload, publish, and update your extension. </li>
- <li> Create some great text (titles and descriptions)
- and images (maybe even video) for your extension.
- See the
- <a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">gallery help</a>
- for details on screenshot and text requirements. </li>
-</ul>
-
-<p>
-To upload your extension,
-just zip up your extension's directory,
-go to the
-<a href="https://chrome.google.com/extensions/developer/dashboard">Developer Dashboard</a>,
-and add your extension.
-This creates a page for your extension,
-viewable only by you.
-Now you can edit your extension's page —
-uploading images, specifying text, and so on.
-</p>
-
-<p>
-Once you verify that your extension's page looks good
-and all links are valid,
-publish your extension.
+<strong>Note:</strong>
+If you've already published extensions to the
+<a href="https://chrome.google.com/extensions">Extensions Gallery</a>,
+they will be merged into the store.
</p>
<p>
-When you want to update your extension,
-use the dashboard to upload and publish the new version.
-Your users will automatically get the new version
-over the next few hours.
+By convention, extensions,
+installable web apps, and themes are served—whether
+by the Chrome Web Store or by a custom server—as
+<code>.crx</code> files.
+When you upload a ZIP file with the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
+the dashboard creates the <code>.crx</code> file for you.
</p>
-
-<h2 id="server">Hosting on your own server</h2>
-
<p>
-By convention, extensions are served —
-whether by the gallery or by a custom server —
-as <code>.crx</code> files.
-When you upload an extension to the gallery,
-the gallery creates the <code>.crx</code> file for you.
-If you aren't using the gallery,
+If you aren't publishing using the dashboard,
you need to create the <code>.crx</code> file yourself,
as described in <a href="packaging.html">Packaging</a>.
-</p>
-
-<p class="note">
-<b>Note:</b>
-If you do your own hosting,
-don't forget to set up
-<a href="autoupdate.html">autoupdate</a>,
-so you can be sure that
-your extension's users have the latest version.
+You can also specify
+<a href="autoupdate.html">autoupdate</a> information to ensure that
+your users will have the latest copy of the <code>.crx</code> file.
</p>
<p>
-A server that hosts extensions
+A server that hosts <code>.crx</code> files
must use appropriate HTTP headers,
-so that users can install your extension
+so that users can install the file
by clicking a link to it.
</p>
<p>
-Google Chrome considers a file to be an extension
+Google Chrome considers a file to be installable
if <b>either</b> of the following is true:
</p>
@@ -460,15 +383,15 @@ if <b>either</b> of the following is true:
</ul>
<p>
-The most common reason for failing to recognize an extension
+The most common reason for failing to recognize an installable file
is that the server sends the header
<code>X-Content-Type-Options: no sniff</code>.
The second most common reason
-is that the server sends an unknown content type —
-one that isn't in the previous list.
+is that the server sends an unknown content type—one
+that isn't in the previous list.
To fix an HTTP header issue,
either change the configuration of the server
-or try hosting the extension at another server.
+or try hosting the <code>.crx</code> file at another server.
</p>
</div>
diff --git a/chrome/common/extensions/docs/i18n-messages.html b/chrome/common/extensions/docs/i18n-messages.html
index ebb1432..cf07efd 100644
--- a/chrome/common/extensions/docs/i18n-messages.html
+++ b/chrome/common/extensions/docs/i18n-messages.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/i18n.html b/chrome/common/extensions/docs/i18n.html
index cfdd957..39d0f83 100644
--- a/chrome/common/extensions/docs/i18n.html
+++ b/chrome/common/extensions/docs/i18n.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -825,10 +826,8 @@ For example:
You can find simple examples of internationalization in the
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/i18n/">examples/api/i18n</a>
directory.
-For a more complete example, see
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/news_i18n/">examples/extensions/news_i18n</a>
-(compare it to
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/news/">examples/extensions/news</a>).
+For a complete example, see
+<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/news/">examples/extensions/news</a>.
For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.
</p>
diff --git a/chrome/common/extensions/docs/idle.html b/chrome/common/extensions/docs/idle.html
index a0e97d1..6b3aa54 100644
--- a/chrome/common/extensions/docs/idle.html
+++ b/chrome/common/extensions/docs/idle.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/images/omnibox.png b/chrome/common/extensions/docs/images/omnibox.png
index a0de009..14b9aa1 100644
--- a/chrome/common/extensions/docs/images/omnibox.png
+++ b/chrome/common/extensions/docs/images/omnibox.png
Binary files differ
diff --git a/chrome/common/extensions/docs/images/perms-hw1.png b/chrome/common/extensions/docs/images/perms-hw1.png
index eb6a79e..224bd2d 100644
--- a/chrome/common/extensions/docs/images/perms-hw1.png
+++ b/chrome/common/extensions/docs/images/perms-hw1.png
Binary files differ
diff --git a/chrome/common/extensions/docs/images/perms-hw2.png b/chrome/common/extensions/docs/images/perms-hw2.png
index 8fd5c47..644a276 100644
--- a/chrome/common/extensions/docs/images/perms-hw2.png
+++ b/chrome/common/extensions/docs/images/perms-hw2.png
Binary files differ
diff --git a/chrome/common/extensions/docs/index.html b/chrome/common/extensions/docs/index.html
index 6dfc1fb..15f26c3 100644
--- a/chrome/common/extensions/docs/index.html
+++ b/chrome/common/extensions/docs/index.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li class="leftNavSelected">Chrome Web Store</li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -323,100 +324,81 @@ cs {
<tbody><tr>
<td>
-<h3>What are Google Chrome Extensions?</h3>
+<h3>What are extensions?</h3>
<p>
-<em>Extensions</em> are small software programs
-that can modify and enhance the functionality of Google Chrome.
+Extensions are small software programs that
+can modify and enhance the functionality of the Chrome browser.
You write them using web technologies such as
HTML, JavaScript, and CSS.
+You can also use the extension system to build
+<a href="apps.html">packaged apps</a>,
+a downloadable kind of
+<a href="http://code.google.com/chrome/apps/index.html">installable web app</a>.
</p>
<p>
-Here are some examples of extensions:
+<img src="images/index/NEW/gmail.png" width="91" height="35" align="right" style="margin-top:0px; margin-left:0.5em" alt="A screenshot of an extension's icon in the browser bar">
+From a user's point of view,
+extensions and packaged apps are very different
+because they present very different user interfaces.
+Extensions have little to no user interface.
+For example, the image to the right shows the icon
+that provides the UI for the
+<a href="samples.html#gmail">Gmail extension</a>.
</p>
-<table class="columns" id="pics">
-<tbody><tr>
- <td>
- <img src="images/index/gmail.png" width="150" height="79">
- </td>
- <td>
- <p>
- <b><a href="samples.html#gmail">Google Mail Checker</a></b><br>
- Uses a <em>browser action</em>
- (icon in the toolbar)
- to display how many unread messages
- are in your Gmail inbox.
- Click the icon to go to your inbox.
- </p>
- </td>
-</tr>
-
-<tr>
- <td>
- <img src="images/index/news.png" width="150" height="79">
- </td>
- <td>
- <p>
- <b><a href="samples.html#news">News Reader</a></b><br>
- Features a browser action that, when clicked,
- shows a popup summarizing the top news items.
- </p>
- </td>
-</tr>
-
-<tr>
- <td>
- <img src="images/index/rss.png" width="150" height="79">
- </td>
- <td>
- <p>
- <b><a href="samples.html#subscribe_page_action">Subscribe in Feed Reader</a></b><br>
- Uses a <em>page action</em>
- (icon in the address bar)
- and <em>content script</em>
- (code injected into a web page)
- to let you subscribe to a feed in the current web page.
- </p>
- </td>
-</tr>
-</tbody></table>
-<br>
+<p>
+<img src="images/index/html5app.png" width="200" height="160" align="right" style="margin-top:0px; margin-left:0.5em" alt="A screenshot of a packaged app that implements a jigsaw puzzle">
+Packaged apps, on the other hand,
+look and feel like regular web apps,
+with a big-screen design
+and rich UI.
+The image to the right shows a jigsaw puzzle game
+implemented by a packaged app.
+</p>
<p>
-To keep up with the latest news on extensions, read the
-<a href="http://blog.chromium.org/">Chromium blog</a> and the
-<a href="http://chrome.blogspot.com/">Google Chrome blog</a>,
-and subscribe to the
-<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">chromium-extensions group</a>.
+Both extensions and packaged apps bundle all their files
+into a single file that the user downloads and installs.
+This bundling means that, unlike ordinary web apps,
+extensions and packaged apps don't need to depend
+on content from the web.
+</p>
+<p>
+You can distribute your extension or packaged app
+by using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>
+to publish to the
+<a href="http://chrome.google.com/webstore">Chrome Web Store</a>.
+For more information, see the
+<a href="http://code.google.com/chrome/webstore">store developer documentation</a>.
</p>
</td>
-
<td style="width:330px">
<h3>How do I start?</h3>
<p>
</p><ol>
<li>
- Follow the
- <a href="getstarted.html">Getting Started tutorial</a>
+ Follow the <a href="getstarted.html">Getting Started tutorial</a>
+ <!-- PENDING: once we have one for packaged apps, change to
+ "for _extensions_ or _packaged_apps_" -->
</li>
<li>
Read the
<a href="overview.html">Overview</a>
</li>
<li>
- <a href="devguide.html">Write</a> and
- <a href="tut_debugging.html">debug</a>
- your extension
+ Keep up-to-date by reading the
+ <a href="http://blog.chromium.org/">Chromium blog</a>
</li>
<li>
- Submit your extension to the
- <a href="https://chrome.google.com/extensions">gallery</a>
- </li>
+ Subscribe to the
+ <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">chromium-extensions group</a>
+ </li>
</ol>
<p></p>
diff --git a/chrome/common/extensions/docs/management.html b/chrome/common/extensions/docs/management.html
index 2c4b4a8..d14251b 100644
--- a/chrome/common/extensions/docs/management.html
+++ b/chrome/common/extensions/docs/management.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -2080,6 +2081,64 @@ For example:</p>
</div><div>
<div>
<dt>
+ <var>description</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>The description of this extension or app.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
<var>version</var>
<em>
@@ -2318,7 +2377,7 @@ For example:</p>
<!-- TYPE -->
<div style="display:inline">
(
- <span class="optional">optional</span>
+ <span class="optional" style="display: none; ">optional</span>
<span class="enum" style="display: none; ">enumerated</span>
<span id="typeTemplate">
<span style="display: none; ">
@@ -2436,6 +2495,144 @@ For example:</p>
</dd>
</div>
+ </div><div>
+ <div>
+ <dt>
+ <var>permissions</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span>
+ array of <span><span>
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span></span>
+ </span>
+ <span style="display: none; ">paramType</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Returns a list of API based permissions.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>hostPermissions</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span>
+ array of <span><span>
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span></span>
+ </span>
+ <span style="display: none; ">paramType</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Returns a list of host based permissions.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
</div>
</dl>
</dd>
diff --git a/chrome/common/extensions/docs/manifest.html b/chrome/common/extensions/docs/manifest.html
index be0dfbb..458421c 100644
--- a/chrome/common/extensions/docs/manifest.html
+++ b/chrome/common/extensions/docs/manifest.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li class="leftNavSelected">Manifest Files</li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -257,6 +258,8 @@
<a href="#H2-1">Field details</a>
<ol>
<li>
+ <a href="#app">app</a>
+ </li><li>
<a href="#default_locale">default_locale</a>
</li><li>
<a href="#description">description</a>
@@ -330,10 +333,10 @@
<div id="pageData-showTOC" class="pageData">true</div>
<p>
-Every extension has a
+Every extension, installable web app, and theme has a
<a href="http://www.json.org">JSON</a>-formatted manifest file,
named <code>manifest.json</code>,
-that provides important information about the extension.
+that provides important information.
</p>
<h2 id="overview"> Field summary </h2>
@@ -341,7 +344,7 @@ that provides important information about the extension.
<p>
The following code shows the supported manifest fields,
with links to the page that discusses each field.
-The only fields that are required for every extension
+The only fields that are always required
are <b>name</b> and <b>version</b>.
</p>
@@ -359,6 +362,7 @@ are <b>name</b> and <b>version</b>.
"<a href="browserAction.html">browser_action</a>": {...},
"<a href="pageAction.html">page_action</a>": {...},
"<a href="themes.html">theme</a>": {...},
+ "<a href="#app">app</a>": {...},
<em>// Add any of these that you need</em>
"<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html",
@@ -368,6 +372,7 @@ are <b>name</b> and <b>version</b>.
"<a href="#incognito">incognito</a>": "spanning" <em>or</em> "split",
"<a href="#key">key</a>": "<em>publicKey</em>",
"<a href="#minimum_chrome_version">minimum_chrome_version</a>": "<em>versionString</em>",
+ "<a href="omnibox.html">omnibox</a>": { "keyword" : "<em>aString</em>" },
"<a href="options.html">options_page</a>": "<em>aFile</em>.html",
"<a href="#permissions">permissions</a>": [...],
"<a href="npapi.html">plugins</a>": [...],
@@ -385,6 +390,24 @@ with links to where they're described in detail,
see the <a href="#overview">Field summary</a>.
</p>
+
+<h3 id="app">app</h3>
+
+<p>
+Used by installable web apps,
+including packaged apps,
+to specify the URLs that the app uses.
+Most important is the <em>launch page</em> for the app—the
+page that the browser goes to when the user clicks the app's icon
+in the New Tab page.
+</p>
+
+<p>
+For details, see the documentation for
+<a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted apps</a> and
+<a href="apps.html">packaged apps</a>.
+</p>
+
<h3 id="default_locale">default_locale</h3>
<p>
@@ -407,7 +430,7 @@ no more than 132 characters)
that describes the extension.
The description should be suitable for both
the browser's extension management UI
-and the <a href="https://chrome.google.com/extensions">extension gallery</a>.
+and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>.
You can specify locale-specific strings for this field;
see <a href="i18n.html">Internationalization</a> for details.
</p>
@@ -418,22 +441,23 @@ see <a href="i18n.html">Internationalization</a> for details.
The URL of the homepage for this extension. The extensions management page (chrome://extensions)
will contain a link to this URL. This field is particularly useful if you
<a href="hosting.html">host the extension on your own site</a>. If you distribute your
-extension using the <a href="http://chrome.google.com/extensions">gallery</a>,
+extension using the <a href="https://chrome.google.com/extensions">Extensions Gallery</a>,
the homepage URL defaults to the extension's own gallery page.
+<!-- PENDING: check whether the same is true of the store -->
</p>
<h3 id="icons">icons</h3>
<p>
-One or more icons that represent the extension.
-You should provide icons in at least two sizes —
-48x48 and 128x128 pixels.
-The 48x48 icon is used in the extensions management page
+One or more icons that represent the extension, app, or theme.
+You should always provide a 128x128 icon;
+it's used during installation and by the Chrome Web Store.
+Extensions should also provide a 48x48 icon,
+which is used in the extensions management page
(chrome://extensions).
-The 128x128 icon is used when the user installs the extension.
You can also specify a 16x16 icon to be used as the favicon
-for the extension's pages.
-The 16x16 icon is also displayed in the experimental
+for an extension's pages.
+The 16x16 icon is also displayed in the experimental extension
<a href="experimental.infobars.html">infobar</a>
feature.
</p>
@@ -452,28 +476,28 @@ Here's an example of specifying the icons:
</pre>
<p class="note">
-<b>Note:</b>
+<b>Important:</b>
Use only the documented icon sizes.
<br><br>
-You may notice that Google Chrome sometimes resizes these icons down to smaller
-sizes. For example, as of this writing, the install dialog shrinks the 128-pixel
+You might notice that Chrome sometimes resizes these icons down to smaller
+sizes. For example, the install dialog might shrink the 128-pixel
icon down to 69 pixels.
<br><br>
-Nevertheless, you should use only the documented sizes. The details of Google
-Chrome's UI may change between versions. These changes are made assuming that
-extension developers are using the documented sizes. If you use other sizes,
+However, the details of
+Chrome's UI may change between versions, and these changes assume that
+developers are using the documented sizes. If you use other sizes,
your icon may look bad in future versions of the browser.
</p>
<p>
-If you submit your extension to the
-<a href="https://chrome.google.com/extensions">gallery</a>,
+If you upload your extension, app, or theme using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
you'll need to upload additional images,
-including a 32x32-pixel logo
-and at least one screenshot of your extension.
-For more information on gallery requirements,
+including at least one screenshot of your extension.
+For more information,
see the
-<a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">gallery help</a>.
+<a href="http://code.google.com/chrome/webstore/">Chrome Web Store
+developer documentation</a>.
</p>
<h3 id="incognito">incognito</h3>
@@ -511,12 +535,12 @@ incognito behavior.
<p>
This value can be used to control
-the unique ID of an extension when
+the unique ID of an extension, app, or theme when
it is loaded during development.
</p>
<p class="note">
-<b>Note:</b> Most extensions should not need to
+<b>Note:</b> You don't usually need to
use this value. Instead, write your
code so that the key value doesn't matter
by using <a href="overview.html#relative-urls">relative paths</a>
@@ -527,7 +551,7 @@ and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>.
To get a suitable key value, first
install your extension from a <code>.crx</code> file
(you may need to
-<a href="hosting.html#gallery">upload your extension to the gallery</a>,
+<a href="https://chrome.google.com/webstore/developer/dashboard">upload your extension</a>
or <a href="packaging.html">package it manually</a>).
Then, in your
<a href="http://www.chromium.org/user-experience/user-data-directory">user
@@ -539,7 +563,7 @@ You will see the key value filled in there.
<h3 id="minimum_chrome_version">minimum_chrome_version</h3>
<p>
-The version of Google Chrome that your extension requires, if any.
+The version of Chrome that your extension, app, or theme requires, if any.
The format for this string is the same as for the
<a href="#version">version</a> field.
@@ -551,7 +575,7 @@ A short, plain text string
that identifies the extension.
The name is used in the install dialog,
extension management UI,
-and the <a href="https://chrome.google.com/extensions">extension gallery</a>.
+and the <a href="https://chrome.google.com/webstore">store</a>.
You can specify locale-specific strings for this field;
see <a href="i18n.html">Internationalization</a> for details.
</p>
@@ -559,18 +583,20 @@ see <a href="i18n.html">Internationalization</a> for details.
<h3 id="permissions">permissions</h3>
<p>
-An array of permissions that the extension might use.
+An array of permissions that the extension or app might use.
Each permission can be either one of a list of known strings
-(such as "tabs")
+(such as "geolocation")
or a match pattern
that gives access to one or more hosts.
-These permissions are displayed to users before installation.
-Permissions might also help to limit damage
-if your extension is attacked.
+Permissions can help to limit damage
+if your extension or app is attacked.
+Some permissions are also displayed to users before installation,
+as detailed in
+<a href="permission_warnings.html">Permission Warnings</a>.
</p>
<p>
-If an API requires you to declare a permission in the manifest,
+If an extension API requires you to declare a permission in the manifest,
then its documentation tells you how to do so.
For example,
the <a href="tabs.html">Tabs</a> page
@@ -579,7 +605,8 @@ declare the "tabs" permission.
</p>
<p>
-Here's an example of the permissions part of a manifest file:
+Here's an example of the permissions part of a manifest file
+for an extension:
</p>
<pre>"permissions": [
@@ -592,7 +619,15 @@ Here's an example of the permissions part of a manifest file:
</pre>
<p>
-The following table lists the permissions an extension can use.
+The following table lists the permissions an extension
+or packaged app can use.
+</p>
+
+<p class="note">
+<strong>Note:</strong>
+Hosted apps can use the
+"geolocation", "notifications", and "unlimitedStorage" permissions,
+but not any other permissions listed in this table.
</p>
<table>
@@ -747,7 +782,7 @@ For more information, see
<a href="autoupdate.html">Autoupdating</a>.
</p>
-<!-- [PENDING: Possibly: point to the gallery and make a big deal of the fact that autoupdating is free if you use the gallery.] -->
+<!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the fact that autoupdating is free if you use them.] -->
</div>
<!-- API PAGE -->
diff --git a/chrome/common/extensions/docs/match_patterns.html b/chrome/common/extensions/docs/match_patterns.html
index 5ad8e75..c9aa23c 100644
--- a/chrome/common/extensions/docs/match_patterns.html
+++ b/chrome/common/extensions/docs/match_patterns.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li class="leftNavSelected">Match Patterns</li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/messaging.html b/chrome/common/extensions/docs/messaging.html
index 2871fa0..4d7d884 100644
--- a/chrome/common/extensions/docs/messaging.html
+++ b/chrome/common/extensions/docs/messaging.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/notifications.html b/chrome/common/extensions/docs/notifications.html
index e705b9d..3afbd73 100644
--- a/chrome/common/extensions/docs/notifications.html
+++ b/chrome/common/extensions/docs/notifications.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li class="leftNavSelected">Desktop Notifications</li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/npapi.html b/chrome/common/extensions/docs/npapi.html
index 8302ab3..19fdc3a 100644
--- a/chrome/common/extensions/docs/npapi.html
+++ b/chrome/common/extensions/docs/npapi.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/omnibox.html b/chrome/common/extensions/docs/omnibox.html
new file mode 100644
index 0000000..e983fc7
--- /dev/null
+++ b/chrome/common/extensions/docs/omnibox.html
@@ -0,0 +1,1939 @@
+<!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
+ 1) The <head> information in this page is significant, should be uniform
+ across api docs and should be edited only with knowledge of the
+ templating mechanism.
+ 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
+ browser, it will be re-generated from the template, json schema and
+ authored overview content.
+ 4) The <body>.innerHTML is also generated by an offline step so that this
+ page may easily be indexed by search engines.
+--><html xmlns="http://www.w3.org/1999/xhtml"><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
+ <link href="css/print.css" rel="stylesheet" type="text/css" media="print">
+ <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js">
+ </script>
+ <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>
+ <title>Omnibox - Google Chrome Extensions - Google Code</title></head>
+ <body> <div id="gc-container" class="labs">
+ <div id="devModeWarning">
+ 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>
+ <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION -->
+ <!-- In particular, sub-templates that recurse, must be used by allowing
+ jstemplate to make a copy of the template in this section which
+ are not operated on by way of the jsskip="true" -->
+ <div style="display:none">
+
+ <!-- VALUE -->
+ <div id="valueTemplate">
+ <dt>
+ <var>paramName</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum">enumerated</span>
+ <span id="typeTemplate">
+ <span>
+ <a> Type</a>
+ </span>
+ <span>
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd>
+ Description of this parameter from the json schema.
+ </dd>
+ <dd>
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd>
+ <div></div>
+ </dd>
+
+ </div> <!-- /VALUE -->
+
+ <div id="functionParametersTemplate">
+ <h5>Parameters</h5>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div> <!-- /SUBTEMPLATES -->
+
+ <a id="top"></a>
+ <div id="skipto">
+ <a href="#gc-pagecontent">Skip to page content</a>
+ <a href="#gc-toc">Skip to main navigation</a>
+ </div>
+ <!-- API HEADER -->
+ <table id="header" width="100%" cellspacing="0" border="0">
+ <tbody><tr>
+ <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td>
+ <td valign="middle" width="100%" style="padding-left:0.6em;">
+ <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em">
+ <div id="gsc-search-box">
+ <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno">
+ <input type="hidden" name="ie" value="UTF-8">
+ <input type="text" name="q" value="" size="55">
+ <input class="gsc-search-button" type="submit" name="sa" value="Search">
+ <br>
+ <span class="greytext">e.g. "page action" or "tabs"</span>
+ </div>
+ </form>
+
+ <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
+ <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse&amp;t13n_langs=en"></script>
+ <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse&amp;lang=en"></script>
+ </td>
+ </tr>
+ </tbody></table>
+
+ <div id="codesiteContent" class="">
+
+ <a id="gc-topnav-anchor"></a>
+ <div id="gc-topnav">
+ <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1>
+ <ul id="home" class="gc-topnav-tabs">
+ <li id="home_link">
+ <a href="index.html" title="Google Chrome Extensions home page">Home</a>
+ </li>
+ <li id="docs_link">
+ <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a>
+ </li>
+ <li id="faq_link">
+ <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a>
+ </li>
+ <li id="samples_link">
+ <a href="samples.html" title="Sample extensions (with source code)">Samples</a>
+ </li>
+ <li id="group_link">
+ <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a>
+ </li>
+ </ul>
+ </div> <!-- end gc-topnav -->
+
+ <div class="g-section g-tpl-170">
+ <!-- SIDENAV -->
+ <div class="g-unit g-first" id="gc-toc">
+ <ul>
+ <li><a href="getstarted.html">Getting Started</a></li>
+ <li><a href="overview.html">Overview</a></li>
+ <li><a href="whats_new.html">What's New?</a></li>
+ <li><h2><a href="devguide.html">Developer's Guide</a></h2>
+ <ul>
+ <li>Browser UI
+ <ul>
+ <li><a href="browserAction.html">Browser Actions</a></li>
+ <li><a href="contextMenus.html">Context Menus</a></li>
+ <li><a href="notifications.html">Desktop Notifications</a></li>
+ <li class="leftNavSelected">Omnibox</li>
+ <li><a href="options.html">Options Pages</a></li>
+ <li><a href="override.html">Override Pages</a></li>
+ <li><a href="pageAction.html">Page Actions</a></li>
+ </ul>
+ </li>
+ <li>Browser Interaction
+ <ul>
+ <li><a href="bookmarks.html">Bookmarks</a></li>
+ <li><a href="cookies.html">Cookies</a></li>
+ <li><a href="events.html">Events</a></li>
+ <li><a href="history.html">History</a></li>
+ <li><a href="management.html">Management</a></li>
+ <li><a href="tabs.html">Tabs</a></li>
+ <li><a href="windows.html">Windows</a></li>
+ </ul>
+ </li>
+ <li>Implementation
+ <ul>
+ <li><a href="a11y.html">Accessibility</a></li>
+ <li><a href="background_pages.html">Background Pages</a></li>
+ <li><a href="content_scripts.html">Content Scripts</a></li>
+ <li><a href="xhr.html">Cross-Origin XHR</a></li>
+ <li><a href="idle.html">Idle</a></li>
+ <li><a href="i18n.html">Internationalization</a></li>
+ <li><a href="messaging.html">Message Passing</a></li>
+ <li><a href="npapi.html">NPAPI Plugins</a></li>
+ </ul>
+ </li>
+ <li>Finishing
+ <ul>
+ <li><a href="hosting.html">Hosting</a></li>
+ <li><a href="external_extensions.html">Other Deployment Options</a></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
+ <li><h2><a href="tutorials.html">Tutorials</a></h2>
+ <ul>
+ <li><a href="tut_debugging.html">Debugging</a></li>
+ <li><a href="tut_analytics.html">Google Analytics</a></li>
+ <li><a href="tut_oauth.html">OAuth</a></li>
+ </ul>
+ </li>
+ <li><h2>Reference</h2>
+ <ul>
+ <li>Formats
+ <ul>
+ <li><a href="manifest.html">Manifest Files</a></li>
+ <li><a href="match_patterns.html">Match Patterns</a></li>
+ </ul>
+ </li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
+ <li><a href="api_index.html">chrome.* APIs</a></li>
+ <li><a href="api_other.html">Other APIs</a></li>
+ </ul>
+ </li>
+ <li><h2><a href="samples.html">Samples</a></h2></li>
+ <div class="line"> </div>
+ <li><h2>More</h2>
+ <ul>
+ <li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
+ <li><a href="themes.html">Themes</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <script>
+ initToggles();
+ </script>
+
+ <div class="g-unit" id="gc-pagecontent">
+ <div id="pageTitle">
+ <h1 class="page_title">Omnibox</h1>
+ </div>
+ <!-- TABLE OF CONTENTS -->
+ <div id="toc">
+ <h2>Contents</h2>
+ <ol>
+ <li>
+ <a href="#manifest">Manifest</a>
+ <ol>
+ <li style="display: none; ">
+ <a>h3Name</a>
+ </li>
+ </ol>
+ </li><li>
+ <a href="#examples">Examples</a>
+ <ol>
+ <li style="display: none; ">
+ <a>h3Name</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#apiReference">API reference: chrome.omnibox</a>
+ <ol>
+ <li style="display: none; ">
+ <a href="#properties">Properties</a>
+ <ol>
+ <li>
+ <a href="#property-anchor">propertyName</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#methods">Methods</a>
+ <ol>
+ <li style="display: none; ">
+ <a href="#method-anchor">methodName</a>
+ </li><li>
+ <a href="#method-setDefaultSuggestion">setDefaultSuggestion</a>
+ </li><li>
+ <a href="#method-styleDim">styleDim</a>
+ </li><li>
+ <a href="#method-styleMatch">styleMatch</a>
+ </li><li>
+ <a href="#method-styleUrl">styleUrl</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#events">Events</a>
+ <ol>
+ <li>
+ <a href="#event-onInputCancelled">onInputCancelled</a>
+ </li><li>
+ <a href="#event-onInputChanged">onInputChanged</a>
+ </li><li>
+ <a href="#event-onInputEntered">onInputEntered</a>
+ </li><li>
+ <a href="#event-onInputStarted">onInputStarted</a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="#types">Types</a>
+ <ol>
+ <li>
+ <a href="#type-SuggestResult">SuggestResult</a>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ </div>
+ <!-- /TABLE OF CONTENTS -->
+
+ <!-- Standard content lead-in for experimental API pages -->
+ <p id="classSummary" style="display: none; ">
+ For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page.
+ </p>
+
+ <!-- STATIC CONTENT PLACEHOLDER -->
+ <div id="static"><div id="pageData-name" class="pageData">Omnibox</div>
+
+<!-- BEGIN AUTHORED CONTENT -->
+<p>
+The omnibox API allows you to register a
+keyword with Google Chrome's address bar,
+which is also known as the omnibox.
+</p>
+
+<p>
+<img src="images/omnibox.png" width="300" height="150" alt="A screenshot showing suggestions related to the keyword 'Chromium Search'">
+</p>
+
+<p>
+When the user enters your extension's
+keyword, the user starts
+interacting solely with your extension.
+Each keystroke is sent to your
+extension, and you can provide suggestions
+in response.
+</p>
+
+<p>
+The suggestions can be richly formatted
+in a variety of ways.
+<!-- PENDING: for example? (include a mention of method name, maybe show a code snippet) -->
+When the user accepts
+a suggestion, your extension is notified
+and can take action.
+</p>
+
+<h2 id="manifest">Manifest</h2>
+
+<p>
+You must include an <code>omnibox</code> <code>keyword</code> field
+in the <a href="manifest.html">manifest</a>
+to use the omnibox API.
+You should also
+specify a 16x16-pixel icon, which will be
+displayed in the address bar when suggesting that users
+enter keyword mode.
+</p>
+
+<p>
+For example:
+</p>
+
+<pre>{
+ "name": "Aaron's omnibox extension",
+ "version": "1.0",
+ <b>"omnibox": { "keyword" : "aaron" },</b>
+ <b>"icons": {</b>
+ <b>"16": "16-full-color.png"</b>
+ <b>},</b>
+ "background_page": "background.html"
+}</pre>
+
+<p class="note">
+<strong>Note:</strong>
+Chrome automatically creates a grayscale version of
+your 16x16-pixel icon. You should provide
+a full-color version so that it can also be
+used in other situations that require color.
+For example, the <a href="contextMenus.html">context menus API</a> also uses a 16x16-pixel
+icon, but it is displayed in color.
+</p>
+
+
+<h2 id="examples">Examples</h2>
+
+<p>
+You can find samples of this API on the
+<a href="samples.html#omnibox">sample page</a>.
+
+<!-- END AUTHORED CONTENT -->
+</p></div>
+
+ <!-- API PAGE -->
+ <div class="apiPage">
+ <a name="apiReference"></a>
+ <h2>API reference: chrome.omnibox</h2>
+
+ <!-- PROPERTIES -->
+ <div class="apiGroup" style="display: none; ">
+ <a name="properties"></a>
+ <h3 id="properties">Properties</h3>
+
+ <div>
+ <a></a>
+ <h4>getLastError</h4>
+ <div class="summary">
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.extension</span><span>lastError</span>
+ </div>
+ <div>
+ </div>
+ </div>
+
+ </div> <!-- /apiGroup -->
+
+ <!-- METHODS -->
+ <div class="apiGroup" id="methods">
+ <a name="methods"></a>
+ <h3>Methods</h3>
+
+ <!-- iterates over all functions -->
+ <div class="apiItem" style="display: none; ">
+ <a></a> <!-- method-anchor -->
+ <h4>method name</h4>
+
+ <div class="summary"><span>void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.module.methodName</span>(<span><span>, </span><span></span>
+ <var><span></span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo">Undocumented.</p>
+ <p>
+ A description from the json schema def of the function goes here.
+ </p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4>Returns</h4>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div>
+ <div>
+ <h4>Callback function</h4>
+ <p>
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p>
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
+ <a name="method-setDefaultSuggestion"></a> <!-- method-anchor -->
+ <h4>setDefaultSuggestion</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.omnibox.setDefaultSuggestion</span>(<span class="null"><span style="display: none; ">, </span><span>object</span>
+ <var><span>suggestion</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>suggestion</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>object</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>A partial SuggestResult object, without the 'content' parameter. See SuggestResult for a description of the parameters.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>description</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>The text to display in the default suggestion. The placeholder string '%s' can be included and will be replaced with the user's input.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>descriptionStyles</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span>
+ array of <span><span>
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>object</span>
+ <span style="display: none; "></span>
+ </span>
+ </span></span>
+ </span>
+ <span style="display: none; ">paramType</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div style="display: none; ">
+ <div>
+ <h4>Callback function</h4>
+ <p>
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
+ <a name="method-styleDim"></a> <!-- method-anchor -->
+ <h4>styleDim</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.omnibox.styleDim</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
+ <var><span>offset</span></var></span><span class="optional"><span>, </span><span>integer</span>
+ <var><span>length</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of dim helper text. A negative offset means the region will start at that many characters from the end of the description. If length is omitted, the region will apply for the rest of the description text.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>offset</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>integer</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>length</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>integer</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div style="display: none; ">
+ <div>
+ <h4>Callback function</h4>
+ <p>
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
+ <a name="method-styleMatch"></a> <!-- method-anchor -->
+ <h4>styleMatch</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.omnibox.styleMatch</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
+ <var><span>offset</span></var></span><span class="optional"><span>, </span><span>integer</span>
+ <var><span>length</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of text matching what the user typed. A negative offset means the region will start at that many characters from the end of the description. If length is omitted, the region will apply for the rest of the description text.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>offset</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>integer</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>length</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>integer</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div style="display: none; ">
+ <div>
+ <h4>Callback function</h4>
+ <p>
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div><div class="apiItem">
+ <a name="method-styleUrl"></a> <!-- method-anchor -->
+ <h4>styleUrl</h4>
+
+ <div class="summary"><span style="display: none; ">void</span>
+ <!-- Note: intentionally longer 80 columns -->
+ <span>chrome.omnibox.styleUrl</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span>
+ <var><span>offset</span></var></span><span class="optional"><span>, </span><span>integer</span>
+ <var><span>length</span></var></span>)</div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>Constructor for the descriptionStyles parameter of the suggest callback. This style designates a region of text matching a URL or filename. A negative offset means the region will start at that many characters from the end of the description. If length is omitted, the region will apply for the rest of the description text.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>offset</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>integer</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>length</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>integer</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ <!-- RETURNS -->
+ <h4 style="display: none; ">Returns</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ <!-- CALLBACK -->
+ <div style="display: none; ">
+ <div>
+ <h4>Callback function</h4>
+ <p>
+ The callback <em>parameter</em> should specify a function
+ that looks like this:
+ </p>
+ <p>
+ If you specify the <em>callback</em> parameter, it should
+ specify a function that looks like this:
+ </p>
+
+ <!-- Note: intentionally longer 80 columns -->
+ <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </div>
+ </div>
+
+ <!-- MIN_VERSION -->
+ <p style="display: none; ">
+ This function was added in version <b><span></span></b>.
+ If you require this function, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </p>
+ </div> <!-- /description -->
+
+ </div> <!-- /apiItem -->
+
+ </div> <!-- /apiGroup -->
+
+ <!-- EVENTS -->
+ <div class="apiGroup">
+ <a name="events"></a>
+ <h3 id="events">Events</h3>
+
+ <!-- iterates over all events -->
+ <div class="apiItem">
+ <a name="event-onInputCancelled"></a>
+ <h4>onInputCancelled</h4>
+
+ <div class="summary">
+ <!-- Note: intentionally longer 80 columns -->
+ <span class="subdued">chrome.omnibox.</span><span>onInputCancelled</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span>);
+ </div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>User has ended the keyword input session without accepting the input.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ </div> <!-- /decription -->
+
+ </div><div class="apiItem">
+ <a name="event-onInputChanged"></a>
+ <h4>onInputChanged</h4>
+
+ <div class="summary">
+ <!-- Note: intentionally longer 80 columns -->
+ <span class="subdued">chrome.omnibox.</span><span>onInputChanged</span><span class="subdued">.addListener</span>(function(<span>string text, function suggest</span>) <span class="subdued">{...}</span>);
+ </div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>User has changed what is typed into the omnibox.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>text</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>suggest</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>function</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>A callback passed to the onInputChanged event used for sending suggestions back to the browser.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd>
+ <div>
+ <h5>Parameters</h5>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var style="display: none; ">paramName</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span>
+ array of <span><span>
+ <span>
+ <a href="omnibox.html#type-SuggestResult">SuggestResult</a>
+ </span>
+ <span style="display: none; ">
+ <span>
+ array of <span><span></span></span>
+ </span>
+ <span>paramType</span>
+ <span></span>
+ </span>
+ </span></span>
+ </span>
+ <span style="display: none; ">paramType</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>Array of suggest results</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+ </div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ </div> <!-- /decription -->
+
+ </div><div class="apiItem">
+ <a name="event-onInputEntered"></a>
+ <h4>onInputEntered</h4>
+
+ <div class="summary">
+ <!-- Note: intentionally longer 80 columns -->
+ <span class="subdued">chrome.omnibox.</span><span>onInputEntered</span><span class="subdued">.addListener</span>(function(<span>string text</span>) <span class="subdued">{...}</span>);
+ </div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>User has accepted what is typed into the omnibox.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>text</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo">
+ Undocumented.
+ </dd>
+ <dd style="display: none; ">
+ Description of this parameter from the json schema.
+ </dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+
+ </div> <!-- /decription -->
+
+ </div><div class="apiItem">
+ <a name="event-onInputStarted"></a>
+ <h4>onInputStarted</h4>
+
+ <div class="summary">
+ <!-- Note: intentionally longer 80 columns -->
+ <span class="subdued">chrome.omnibox.</span><span>onInputStarted</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span>);
+ </div>
+
+ <div class="description">
+ <p class="todo" style="display: none; ">Undocumented.</p>
+ <p>User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events.</p>
+
+ <!-- PARAMETERS -->
+ <h4>Parameters</h4>
+ <dl>
+ <div style="display: none; ">
+ <div>
+ </div>
+ </div>
+ </dl>
+
+ </div> <!-- /decription -->
+
+ </div> <!-- /apiItem -->
+
+ </div> <!-- /apiGroup -->
+
+ <!-- TYPES -->
+ <div class="apiGroup">
+ <a name="types"></a>
+ <h3 id="types">Types</h3>
+
+ <!-- iterates over all types -->
+ <div class="apiItem">
+ <a name="type-SuggestResult"></a>
+ <h4>SuggestResult</h4>
+
+ <div>
+ <dt>
+ <var style="display: none; ">paramName</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>object</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>A suggest result.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd>
+ <dl>
+ <div>
+ <div>
+ <dt>
+ <var>content</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>description</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional" style="display: none; ">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>string</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>The text that is displayed in the URL dropdown. Can optionally be stylized by the descriptionStyles parameter.</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div><div>
+ <div>
+ <dt>
+ <var>descriptionStyles</var>
+ <em>
+
+ <!-- TYPE -->
+ <div style="display:inline">
+ (
+ <span class="optional">optional</span>
+ <span class="enum" style="display: none; ">enumerated</span>
+ <span id="typeTemplate">
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span>
+ array of <span><span>
+ <span style="display: none; ">
+ <a> Type</a>
+ </span>
+ <span>
+ <span style="display: none; ">
+ array of <span><span></span></span>
+ </span>
+ <span>object</span>
+ <span style="display: none; "></span>
+ </span>
+ </span></span>
+ </span>
+ <span style="display: none; ">paramType</span>
+ <span style="display: none; "></span>
+ </span>
+ </span>
+ )
+ </div>
+
+ </em>
+ </dt>
+ <dd class="todo" style="display: none; ">
+ Undocumented.
+ </dd>
+ <dd>An array of style objects, created using styleUrl, styleMatch, or styleDim. A style applies to the region of text specified by the style's starting offset and length. If there are any overlapping regions of text covered by multiple styles, they will be added together (e.g. 'match' + 'dim' will display a dimmed match). Not all style combinations will be visually distinct (e.g. 'url' + 'dim' may look identical to 'url').</dd>
+ <dd style="display: none; ">
+ This parameter was added in version
+ <b><span></span></b>.
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
+ can ensure that your extension won't be run in an earlier browser version.
+ </dd>
+
+ <!-- OBJECT PROPERTIES -->
+ <dd style="display: none; ">
+ <dl>
+ <div>
+ <div>
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+ </div>
+ </dl>
+ </dd>
+
+ <!-- FUNCTION PARAMETERS -->
+ <dd style="display: none; ">
+ <div></div>
+ </dd>
+
+ </div>
+
+ </div> <!-- /apiItem -->
+
+ </div> <!-- /apiGroup -->
+
+ </div> <!-- /apiPage -->
+ </div> <!-- /gc-pagecontent -->
+ </div> <!-- /g-section -->
+ </div> <!-- /codesiteContent -->
+ <div id="gc-footer" --="">
+ <div class="text">
+ <p>
+ Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>,
+ the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
+ Attribution 3.0 License</a>, and code samples are licensed under the
+ <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>.
+ </p>
+ <p>
+ ©2010 Google
+ </p>
+
+<!-- begin analytics -->
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
+
+<script type="text/javascript">
+ // chrome doc tracking
+ try {
+ var engdocs = _gat._getTracker("YT-10763712-2");
+ engdocs._trackPageview();
+ } catch(err) {}
+
+ // code.google.com site-wide tracking
+ try {
+ _uacct="UA-18071-1";
+ _uanchor=1;
+ _uff=0;
+ urchinTracker();
+ }
+ catch(e) {/* urchinTracker not available. */}
+</script>
+<!-- end analytics -->
+ </div>
+ </div> <!-- /gc-footer -->
+ </div> <!-- /gc-container -->
+</body></html>
diff --git a/chrome/common/extensions/docs/options.html b/chrome/common/extensions/docs/options.html
index cbfb4bd..701630a 100644
--- a/chrome/common/extensions/docs/options.html
+++ b/chrome/common/extensions/docs/options.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li class="leftNavSelected">Options Pages</li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/override.html b/chrome/common/extensions/docs/override.html
index 0eec1ba..6d03561 100644
--- a/chrome/common/extensions/docs/override.html
+++ b/chrome/common/extensions/docs/override.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li class="leftNavSelected">Override Pages</li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/overview.html b/chrome/common/extensions/docs/overview.html
index 1180ff9..2d5760f 100644
--- a/chrome/common/extensions/docs/overview.html
+++ b/chrome/common/extensions/docs/overview.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -249,8 +250,10 @@
<li>
<a href="#what">The basics</a>
<ol>
- <li style="display: none; ">
- <a>h3Name</a>
+ <li>
+ <a href="#extension-ui">Extension UIs</a>
+ </li><li>
+ <a href="#packagedapp-ui">Packaged app UIs</a>
</li>
</ol>
</li><li>
@@ -259,7 +262,7 @@
<li>
<a href="#relative-urls">Referring to files</a>
</li><li>
- <a href="#H3-3">The manifest file</a>
+ <a href="#H3-5">The manifest file</a>
</li>
</ol>
</li><li>
@@ -347,16 +350,22 @@
Once you've finished this page
and the
<a href="getstarted.html">Getting Started</a> tutorial,
-you'll be all set to start writing extensions.
+you'll be all set to start writing extensions and packaged apps.
</p>
+<p class="caution">
+<strong>Note:</strong>
+<em>Packaged apps</em> are implemented as extensions,
+so unless otherwise stated,
+everything in this page applies to packaged apps.
+</p>
<h2 id="what">The basics</h2>
<p>
-An extension is a zipped bundle of files —
-HTML, CSS, JavaScript, images, and anything else you need —
-that adds functionality to the Google Chrome browser.
+An extension is a zipped bundle of files—HTML,
+CSS, JavaScript, images, and anything else you need—that
+adds functionality to the Google Chrome browser.
Extensions are essentially web pages,
and they can use all the
<a href="api_other.html">APIs that the browser provides to web pages</a>,
@@ -364,22 +373,22 @@ from XMLHttpRequest to JSON to HTML5.
</p>
<p>
-Many extensions add UI to Google Chrome,
-in the form of
-<a href="browserAction.html">browser actions</a>
-or <a href="pageAction.html">page actions</a>.
+Extensions can interact with web pages or servers using
+<a href="content_scripts.html">content scripts</a> or
+<a href="xhr.html">cross-origin XMLHttpRequests</a>.
Extensions can also interact programmatically
with browser features such as
<a href="bookmarks.html">bookmarks</a>
and <a href="tabs.html">tabs</a>.
-To interact with web pages or servers,
-extensions can use
-<a href="content_scripts.html">content scripts</a> or
-<a href="xhr.html">cross-origin XMLHttpRequests</a>.
</p>
+<h3 id="extension-ui">Extension UIs</h3>
+
<p>
-<b>Note:</b>
+Many extensions—but not packaged apps—add
+UI to Google Chrome in the form of
+<a href="browserAction.html">browser actions</a>
+or <a href="pageAction.html">page actions</a>.
Each extension can have at most one browser action or page action.
Choose a <b>browser action</b> when the extension is relevant to most pages.
Choose a <b>page action</b> when the extension's icon
@@ -387,13 +396,69 @@ should appear or disappear,
depending on the page.
</p>
+<table class="columns">
+<tbody><tr>
+ <td>
+ <img src="images/index/gmail.png" width="150" height="79" alt="screenshot">
+ </td>
+ <td>
+ <img src="images/index/news.png" width="150" height="79" alt="screenshot">
+ </td>
+ <td>
+ <img src="images/index/rss.png" width="150" height="79" alt="screenshot">
+ </td>
+</tr>
+
+<tr>
+ <td>
+ This <a href="samples.html#gmail">mail extension</a>
+ uses a <em>browser action</em>
+ (icon in the toolbar).
+ </td>
+ <td>
+ This <a href="samples.html#news">news reader extension</a>
+ features a browser action that,
+ when clicked,
+ shows a <em>popup</em>.
+ </td>
+ <td>
+ This <a href="samples.html#mappy">map extension</a>
+ uses a <em>page action</em>
+ (icon in the address bar)
+ and <em>content script</em>
+ (code injected into a web page).
+ </td>
+</tr>
+</tbody></table>
+
<p>
+Extensions (and packaged apps) can also present a UI in other ways,
+such as adding to the Chrome context menu,
+providing an options page,
+or using a content script that changes how pages look.
See the <a href="devguide.html">Developer's Guide</a>
for a complete list of extension features,
-with implementation details
+with links to implementation details
for each one.
</p>
+
+<h3 id="packagedapp-ui">Packaged app UIs</h3>
+
+<p>
+A packaged app usually presents its main functionality using
+an HTML page that's bundled into the app.
+For example, the following packaged app
+displays a Flash file within an HTML page.
+</p>
+
+<img src="images/index/flashapp.png" width="372" height="300" alt="screenshot">
+
+<p>
+For more information,
+see <a href="apps.html">Packaged Apps</a>.
+</p>
+
<h2 id="files">Files</h2>
<p>
Each extension has the following files:
@@ -404,8 +469,8 @@ Each extension has the following files:
<li>A <b>manifest file</b></li>
<li>One or more <b>HTML files</b> (unless the extension is a theme)</li>
<li><em>Optional:</em> One or more <b>JavaScript files</b></li>
- <li><em>Optional:</em> Any other files your extension needs —
- for example, image files</li>
+ <li><em>Optional:</em> Any other files your extension needs—for
+ example, image files</li>
</ul>
<p>
@@ -414,8 +479,9 @@ you put all these files into a single folder.
When you distribute your extension,
the contents of the folder are packaged into a special ZIP file
that has a <code>.crx</code> suffix.
-If you put your extension in the gallery,
-the gallery creates the <code>.crx</code> file for you.
+If you upload your extension using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
+the <code>.crx</code> file is created for you.
For details on distributing extensions,
see <a href="hosting.html">Hosting</a>.
</p>
@@ -459,7 +525,7 @@ it's the same as the relative URL.
<!-- [PENDING: Should mention/reflect/link to <a href="http://dev.chromium.org/developers/design-documents/extensions/i18n">internationalization</a> when it's ready.] -->
-<a name="H3-3"></a><h3>The manifest file</h3>
+<a name="H3-5"></a><h3>The manifest file</h3>
<p>
The manifest file, called <code>manifest.json</code>,
@@ -641,10 +707,11 @@ or by making server requests that result in saving data.
Whenever you want to save something,
first consider whether it's
from a window that's in incognito mode.
-By default, extensions don't run in incognito windows.
-However, users can selectively enable your extension for incognito mode,
-so you need to consider what a user expects
-from your extension in that case.
+By default, extensions don't run in incognito windows,
+and packaged apps <em>do</em>.
+You need to consider what a user expects
+from your extension or packaged app
+when the browser is incognito.
</p>
<p>
diff --git a/chrome/common/extensions/docs/packaging.html b/chrome/common/extensions/docs/packaging.html
index 58b1a9b..4939c6c 100644
--- a/chrome/common/extensions/docs/packaging.html
+++ b/chrome/common/extensions/docs/packaging.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -337,7 +338,7 @@ for example, <code>myextension.crx</code>.
<b>Note:</b>
You might not need to package your extension.
If you publish your extension using the
-<a href="https://chrome.google.com/extensions">gallery</a>,
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
then the only reason to create your own <code>.crx</code> file
would be to distribute a non-public version —
for example, to alpha testers.
@@ -403,8 +404,8 @@ You'll need it later if you want to do any of the following:
</p>
<ul>
<li><a href="#update">Update</a> the extension</li>
-<li>Upload the extension to the
-<a href="https://chrome.google.com/extensions">Extensions Gallery</a> </li>
+<li>Upload the extension using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a></li>
</ul>
<p>
@@ -480,7 +481,8 @@ add <code>--no-message-box</code> to the command.
<p>
For more information on the format, as well as pointers to scripts you can use
to create <code>.crx</code> files, see <a href="crx.html">CRX package format</a>.
-</p></div>
+</p>
+</div>
<!-- API PAGE -->
<div class="apiPage" style="display: none; ">
diff --git a/chrome/common/extensions/docs/pageAction.html b/chrome/common/extensions/docs/pageAction.html
index 17212b7..b086ab8 100644
--- a/chrome/common/extensions/docs/pageAction.html
+++ b/chrome/common/extensions/docs/pageAction.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li class="leftNavSelected">Page Actions</li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -359,6 +360,11 @@ If you want the extension's icon to always be visible,
use a <a href="browserAction.html">browser action</a> instead.
</p>
+<p class="caution">
+<strong>Note:</strong>
+Packaged apps cannot use page actions.
+</p>
+
<h2 id="manifest">Manifest</h2>
diff --git a/chrome/common/extensions/docs/permission_warnings.html b/chrome/common/extensions/docs/permission_warnings.html
index 6d42386..8b59ddd 100644
--- a/chrome/common/extensions/docs/permission_warnings.html
+++ b/chrome/common/extensions/docs/permission_warnings.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li class="leftNavSelected">Permission Warnings</li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -325,9 +326,21 @@
<div id="static"><div id="pageData-name" class="pageData">Permission Warnings</div>
<div id="pageData-showTOC" class="pageData">true</div>
+<!--
+NOTE: When this doc is updated, the online help should also be updated:
+http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=186213
+
+We should periodically look at
+http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?view=markup
+to make sure that we're covering all messages. Search for
+IDS_EXTENSION_PROMPT_WARNING
+(e.g. IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY).
+-->
+
<p>
To use most chrome.* APIs and extension capabilities,
-your extension must declare its intent in the manifest,
+your extension must declare its intent in the
+<a href="manifest.html">manifest</a>,
often in the "permissions" field.
Some of these declarations
result in a warning when
@@ -351,7 +364,7 @@ Here's a typical dialog
that a user might see when installing an extension:
</p>
-<img src="images/perms-hw1.png" width="387" height="162" alt="Permission warning: 'This extension can access: Your data on api.flickr.com'">
+<img src="images/perms-hw1.png" width="410" height="193" alt="Permission warning: 'It can access: Your data on api.flickr.com'">
<p>
The warning about access to data on api.flickr.com
@@ -402,7 +415,7 @@ Clicking the Re-enable button
brings up the following warning:
</p>
-<img src="images/perms-hw2.png" width="387" height="190" alt="Permission warning: 'This extension can access: Your data on api.flickr.com and flickr.com; Your browsing history'">
+<img src="images/perms-hw2.png" width="412" height="220" alt="Permission warning: 'It can access: Your data on api.flickr.com and flickr.com; Your browsing history'">
<h2 id="warnings"> Warnings and their triggers </h2>
@@ -413,8 +426,7 @@ results in the seemingly unrelated warning
that the extension can access your browsing history.
The reason for the warning is that
although the <code>chrome.tabs</code> API
-might be used only to open new tabs
-(<a href="tabs.html#method-create"><code>chrome.tabs.create()</code></a>),
+might be used only to open new tabs,
it can also be used to see the URL that's associated
with every newly opened tab
(using their <a href="tabs.html#type-Tab">Tab</a> objects).
@@ -424,13 +436,14 @@ with every newly opened tab
<b>Note:</b>
As of Google Chrome 7,
you no longer need to specify the "tabs" permission
-just to call <code>chrome.tabs.create()</code>.
+just to call <code>chrome.tabs.create()</code>
+or <code>chrome.tabs.update()</code>.
</p>
<p>
The following table lists the warning messages
that users can see,
-along with the <a href="manifest.html">manifest</a> entries
+along with the manifest entries
that trigger them.
</p>
@@ -442,7 +455,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_FULL_ACCESS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS -->
All data on your computer and the websites you visit
</td>
<td>
@@ -456,7 +469,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_BOOKMARKS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS -->
Your bookmarks
</td>
<td>
@@ -470,7 +483,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY -->
Your browsing history
</td>
<td>
@@ -497,7 +510,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_ALL_HOSTS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS -->
Your data on all websites
</td>
<td>
@@ -530,8 +543,8 @@ that trigger them.
</tr>
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_?_HOST -->
- <!-- IDS_EXTENSION_PROMPT2_WARNING_4_OR_MORE_HOSTS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_?_HOST -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_4_OR_MORE_HOSTS -->
Your data on <em>{list of websites}</em>
</td>
<td>
@@ -564,7 +577,29 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_GEOLOCATION -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT -->
+ Your list of installed apps, extensions, and themes
+ <br>
+ <span style="font-weight:normal; font-style:italic">or</span>
+ <br>
+ Manage themes, extensions, and apps
+
+ <!-- PENDING: remove "Manage...apps" alternative message
+ once the fix is out on stable channel -->
+ <!-- See http://crbug.com/67859 -->
+ </td>
+ <td>
+ "management" permission
+ </td>
+ <td>
+ The "management" permission is required by the
+ <a href="management.html"><code>chrome.management</code></a> module.
+ </td>
+</tr>
+
+<tr>
+ <td style="font-weight:bold">
+ <!-- IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION -->
Your physical location
</td>
<td>
diff --git a/chrome/common/extensions/docs/samples.html b/chrome/common/extensions/docs/samples.html
index 368c2c0..9c44a23 100644
--- a/chrome/common/extensions/docs/samples.html
+++ b/chrome/common/extensions/docs/samples.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/static/apps.html b/chrome/common/extensions/docs/static/apps.html
new file mode 100644
index 0000000..b4696bb
--- /dev/null
+++ b/chrome/common/extensions/docs/static/apps.html
@@ -0,0 +1,171 @@
+<div id="pageData-name" class="pageData">Packaged Apps</div>
+<div id="pageData-showTOC" class="pageData">true</div>
+
+<p>
+This page talks about packaged apps&mdash;how
+you implement them,
+and how they're different from
+extensions and ordinary web apps.
+</p>
+
+
+<h2 id="overview">Overview</h2>
+
+<p>
+A packaged app is a web app
+that's bundled into a <code>.crx</code> file
+and can use Chrome extension features.
+You build a packaged app just like you build an extension,
+except that a packaged app can't include a
+<a href="browserAction.html">browser action</a> or
+<a href="pageAction.html">page action</a>.
+Instead, a packaged app includes at least one HTML file
+within its <code>.crx</code> file
+that provides the app's user interface.
+</p>
+
+<p>
+Packaged apps are a type of
+<a href="http://code.google.com/chrome/apps/">installable web app</a>&mdash;a
+web app that can be installed in Chrome.
+The other type of installable web app is a
+<a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted app</a>,
+which is an ordinary web app with a bit of additional metadata.
+</p>
+
+<p>
+If you're developing a web app for the Chrome Web Store,
+you might want to use a packaged app
+instead of a hosted app if any of the following are true:
+</p>
+
+<ul>
+ <li>
+ You don't want to run a service to host your app.
+ </li>
+ <li>
+ You want to build an app that works really well offline.
+ </li>
+ <li>
+ You want tighter integration with Chrome,
+ using the extension APIs.
+ </li>
+</ul>
+
+<p>
+The following articles can help you understand
+the differences between web apps and websites,
+extensions and packaged apps, and packaged apps and hosted apps:
+</p>
+
+<ul>
+ <li> <a href="http://code.google.com/chrome/apps/articles/thinking_in_web_apps.html">Thinking in Web Apps</a> </li>
+ <li> <a href="http://codesite-staging:29006/chrome/webstore/articles/apps_vs_extensions.html">Extensions, Packaged Apps, and Hosted Apps in the Chrome Web Store</a> </li>
+</ul>
+
+
+<h2 id="manifest"> The manifest </h2>
+
+<p>
+A packaged app's manifest can have any field
+that's available to extensions,
+except for "browser_action" and "page_action".
+In addition, a packaged app's manifest <b>must</b>
+have an "app" field.
+Here is a typical manifest for a packaged app:
+</p>
+
+<pre>
+{
+ "name": "My Awesome Racing Game",
+ "description": "Enter a world where a Vanagon can beat a Maserati",
+ "version": "1",
+ <b>"app": {
+ "launch": {
+ "local_path": "main.html"
+ }
+ },</b>
+ "icons": {
+ "16": "icon_16.png",
+ "128": "icon_128.png"
+ },
+ "permissions": [
+ "unlimitedStorage",
+ "notifications"
+ ]
+}
+</pre>
+
+<p>
+The "app" field has one subfield, "launch",
+which specifies the <em>launch page</em> for the app&mdash;the
+page (HTML file bundled into the <code>.crx</code> file)
+that the browser goes to when the user clicks the app's icon
+in the New Tab page.
+The "launch" field can contain the following:
+</p>
+
+<dl>
+ <dt>local_path:</dt>
+ <dd><em>Required.</em>
+ Specifies the launch page
+ as a relative path referring to a file
+ in the <code>.crx</code> package.
+ </dd>
+ <dt>container:</dt>
+ <dd> The value "panel" makes the app appear
+ in an app panel.
+ By default, or when you specify "tab",
+ the app appears in a tab.
+
+ <!-- PENDING: In the overview
+ (or somewhere else before here)
+ we should show and define both app panels and tabs.
+ We should link to that place from here. -->
+ </dd>
+ <dt>height:</dt>
+ <dd>
+ If the container is set to "panel",
+ this integer specifies the height
+ of the panel in pixels.
+ For example, you might specify
+ <code>"height":400</code>.
+ Note that you don't use quotation marks in the value.
+ This field specifies the height of the area
+ to display contents in;
+ window decorations add a few more pixels to the total height.
+ If the container isn't a panel, this field is ignored.
+ </dd>
+ <dt>width:</dt>
+ <dd>
+ Similar to "height",
+ but specifies the width of the panel.
+ </dd>
+ </dd>
+</dl>
+
+<p>
+Packaged apps usually provide a 16x16 icon
+to be used as the favicon for
+tabs that contain app's pages.
+They also should provide a 128x128 icon,
+but not a 48x48 icon.
+See the manifest documentation for the
+<a href="manifest.html#icons">"icons" field</a>
+for more information.
+</p>
+
+<p>
+For further details on what a packaged app's manifest can contain, see the
+<a href="manifest.html">manifest documentation</a>.
+</p>
+
+<h2 id="next">What next?</h2>
+
+<p>
+Read the <a href="overview.html">Overview</a> to learn
+basic concepts about extensions.
+</p>
+
+<p class="backtotop"><a href="#top">Back to top</a></p>
+
diff --git a/chrome/common/extensions/docs/static/autoupdate.html b/chrome/common/extensions/docs/static/autoupdate.html
index 4c8f28f..1d18930 100644
--- a/chrome/common/extensions/docs/static/autoupdate.html
+++ b/chrome/common/extensions/docs/static/autoupdate.html
@@ -3,9 +3,9 @@
<p>We want extensions to be autoupdated for some of the same reasons as Google Chrome itself: to incorporate bug and security fixes, add new features or performance enhancements, and improve user interfaces.</p>
-<p>If you distribute your extension using the <a href="https://chrome.google.com/extensions">gallery</a>, you can <em>ignore this page</em>. You can use a web interface to release updated versions of your extension.</p>
+<p>If you publish your extension using the <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>, you can <em>ignore this page</em>. You can use the dashboard to release updated versions of your extension to users, as well as to the Extensions Gallery or Chrome Web Store.</p>
-<p>If you want to host your extension somewhere other than the gallery, keep reading.
+<p>If you want to host your extension somewhere other than the gallery or store, keep reading.
You should also read <a href="hosting.html">Hosting</a> and
<a href="packaging.html">Packaging</a>.</p>
diff --git a/chrome/common/extensions/docs/static/browserAction.html b/chrome/common/extensions/docs/static/browserAction.html
index 2a35b5d..40da968 100644
--- a/chrome/common/extensions/docs/static/browserAction.html
+++ b/chrome/common/extensions/docs/static/browserAction.html
@@ -28,6 +28,11 @@ use a <a href="pageAction.html">page action</a>
instead of a browser action.
</p>
+<p class="caution">
+<strong>Note:</strong>
+Packaged apps cannot use browser actions.
+</p>
+
<!-- [PENDING: We should show tooltips and badges, as well.] -->
<h2 id="manifest">Manifest</h2>
diff --git a/chrome/common/extensions/docs/static/devguide.html b/chrome/common/extensions/docs/static/devguide.html
index cd9e44c..79545ff 100644
--- a/chrome/common/extensions/docs/static/devguide.html
+++ b/chrome/common/extensions/docs/static/devguide.html
@@ -4,6 +4,8 @@
These pages assume you've completed
the <a href="getstarted.html">Getting Started</a> tutorial
and <a href="overview.html">Overview</a>.
+Unless otherwise stated, everything in this page
+applies to packaged apps, as well as extensions.
</p>
<table class="columns">
@@ -15,13 +17,17 @@ and <a href="overview.html">Overview</a>.
</tr>
<tr>
<td> <a href="browserAction.html">Browser&nbsp;Actions</a> </td>
- <td> Add icons to the toolbar </td>
+ <td> Add icons to the toolbar <em>(extensions only)</em> </td>
</tr>
<tr>
<td> <a href="notifications.html">Desktop&nbsp;Notifications</a> </td>
<td> Notify users of important events </td>
</tr>
<tr>
+ <td> <a href="omnibox.html">Omnibox</a> </td>
+ <td> Add a keyword to the address bar </td>
+ </tr>
+ <tr>
<td> <a href="options.html">Options&nbsp;Pages</a> </td>
<td> Let users customize your extension </td>
</tr>
@@ -32,7 +38,7 @@ and <a href="overview.html">Overview</a>.
</tr>
<tr>
<td> <a href="pageAction.html">Page&nbsp;Actions</a> </td>
- <td> Add temporary icons inside the address bar </td>
+ <td> Add temporary icons inside the address bar <em>(extensions only)</em> </td>
</tr>
<tr>
<td> <a href="themes.html">Themes</a> </td>
@@ -118,7 +124,7 @@ and <a href="overview.html">Overview</a>.
</tr>
<tr>
<td> <a href="hosting.html">Hosting</a> </td>
- <td> Host extensions in the Extensions Gallery or on your own servers </td>
+ <td> Host extensions on Google servers or your own </td>
</tr>
<tr>
<td> <a href="external_extensions.html">Other Deployment Options</a> </td>
diff --git a/chrome/common/extensions/docs/static/docs.html b/chrome/common/extensions/docs/static/docs.html
index fc1ffd3..5dafa68 100644
--- a/chrome/common/extensions/docs/static/docs.html
+++ b/chrome/common/extensions/docs/static/docs.html
@@ -1,16 +1,26 @@
<div id="pageData-name" class="pageData">Hello There!</div>
<p>
-This documentation tells you how to write <em>Google Chrome Extensions</em> &mdash;
-small software programs
-that can modify and enhance the functionality of the
+This documentation tells you how to write extensions
+and packaged apps for the
<a href="http://www.google.com/chrome">Google Chrome browser</a>.
+Because extensions came first,
+the APIs and these docs say <em>extension</em> everywhere,
+even though almost everything applies to packaged apps, as well.
</p>
+<p class="caution">
+<b>Note:</b>
+Unless you see a note
+describing an exception for packaged apps,
+everything in this documentation applies to both extensions and packaged apps.
+</p>
+
+
<h2 id="readme"> Where to start </h2>
<p>
-Before you write an extension,
+Before you code,
read these:
</p>
@@ -37,10 +47,11 @@ Also check out these:
<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">Group: chromium-extensions</a>
</li>
<li>
- <a href="http://code.google.com/chrome/extensions/index.html">Home: Google Chrome Extensions</a>
+ <a href="http://chrome.google.com/webstore">Chrome Web Store</a>
</li>
<li>
- <a href="https://chrome.google.com/extensions">Gallery</a>
+ <a href="http://code.google.com/chrome/webstore/">Chrome Web Store
+ developer documentation</a>
</li>
</ul>
diff --git a/chrome/common/extensions/docs/static/experimental.html b/chrome/common/extensions/docs/static/experimental.html
index d36ffbe..ac54045 100644
--- a/chrome/common/extensions/docs/static/experimental.html
+++ b/chrome/common/extensions/docs/static/experimental.html
@@ -10,12 +10,12 @@ on the following experimental APIs:
<a jsvalues=".href: $this + '.html'" jscontent="$this"></a></li>
</ul>
-<p class="caution">
+<p class="warning">
<b>Caution:</b>
Don't depend on these experimental APIs.
They might disappear,
and they <em>will</em> change.
-Also, the extension gallery doesn't allow you to
+Also, the Chrome Developer Dashboard doesn't allow you to
upload extensions that use experimental APIs.
</p>
diff --git a/chrome/common/extensions/docs/static/faq.html b/chrome/common/extensions/docs/static/faq.html
index e9c6908..482cff2 100644
--- a/chrome/common/extensions/docs/static/faq.html
+++ b/chrome/common/extensions/docs/static/faq.html
@@ -6,33 +6,35 @@
<p>
If you don't find an answer to your question here,
try the
-<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">group</a> or the
+<a href="http://code.google.com/chrome/webstore/faq.html">Chrome Web Store FAQ</a>, the
+<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">group</a>, or the
<a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">gallery help</a>.
+<!-- PENDING: add a link to store help -->
</p>
<div id="faq-TOC">
<h4>General</h4>
<ul>
<li><a href="#faq-gen-01">What are Google Chrome Extensions?</a></li>
- <li><a href="#faq-gen-02">What technologies are used to write extensions for Google Chrome?</a></li>
+ <li><a href="#faq-gen-02">What technologies are used to write extensions for Chrome?</a></li>
<li><a href="#faq-gen-03">Are extensions fetched from the web every time the browser is loaded?</a></li>
</ul>
<h4>Development</h4>
<ul>
- <li><a href="#faq-dev-01">How can I set up Google Chrome for extension development?</a></li>
+ <li><a href="#faq-dev-01">How can I set up Chrome for extension development?</a></li>
<li><a href="#faq-dev-02">Can I make cross-domain Ajax requests in an extension?</a></li>
<li><a href="#faq-dev-03">Can I use 3rd party web services in my extension?</a></li>
<li><a href="#faq-dev-04">Can I use OAuth in my extensions?</a></li>
<li><a href="#faq-dev-05">What UI controls can I create for my extension?</a></li>
<li><a href="#faq-dev-06">Can I load DLLs in my extension?</a></li>
- <li><a href="#faq-dev-07">Can Google Chrome Extensions encode/decode JSON data?</a></li>
+ <li><a href="#faq-dev-07">Can extensions encode/decode JSON data?</a></li>
<li><a href="#faq-dev-08">Can I store data locally in my extension?</a></li>
<li><a href="#faq-dev-09">How much data can I store in localStorage?</a></li>
<li><a href="#faq-dev-10">Can I create an options menu for my application?</a></li>
<li><a href="#faq-dev-11">Can two extensions communicate with each other?</a></li>
<li><a href="#faq-dev-12">What debugging tools are available to extension developers?</a></li>
<li><a href="#faq-dev-13">Can extensions use Google Analytics?</a></li>
- <li><a href="#faq-dev-14">How do I determine which version of Google Chrome is deployed to which channel?</a></li>
+ <li><a href="#faq-dev-14">How do I determine which version of Chrome is deployed to which channel?</a></li>
<li><a href="#faq-dev-15">Can I add a content script to chrome:// URLs?</a></li>
<li><a href="#faq-dev-16">Why do wildcard matches not work for top level domains (TLDs)?</a></li>
</ul>
@@ -47,17 +49,17 @@ try the
<h3 id="faq-gen-01">What are Google Chrome Extensions?</h3>
<p>
- Google Chrome Extensions are applications that run inside the Google
+ Google Chrome Extensions are applications that run inside the
Chrome browser and provide additional functionality, integration with third
party websites or services, and customized browsing experiences.
</p>
-<h3 id="faq-gen-02">What technologies are used to write extensions for Google Chrome?</h3>
+<h3 id="faq-gen-02">What technologies are used to write extensions for Chrome?</h3>
<p>
- Google Chrome Extensions are written using the same standard web
+ Extensions are written using the same standard web
technologies that developers use to create websites. HTML is used as a
content markup language, CSS is used for styling, and JavaScript for
- scripting. Because Google Chrome supports HTML5 and CSS3, developers can
+ scripting. Because Chrome supports HTML5 and CSS3, developers can
use the latest open web technologies such as canvas and CSS animations in
their extensions. Extensions also have access to several
<a href="http://code.google.com/chrome/extensions/api_other.html">JavaScript APIs</a>
@@ -68,7 +70,7 @@ try the
<h3 id="faq-gen-03">Are extensions fetched from the web every time the browser is loaded?</h3>
<p>
- Extensions are downloaded by the Google Chrome browser upon install, and
+ Extensions are downloaded by the Chrome browser upon install, and
are subsequently run off of the local disk in order to speed up
performance. However, if a new version of the extension is pushed online,
it will be automatically downloaded in the background to any users who
@@ -81,9 +83,9 @@ try the
<h2>Development</h2>
-<h3 id="faq-dev-01">How can I set up Google Chrome for extension development?</h3>
+<h3 id="faq-dev-01">How can I set up Chrome for extension development?</h3>
<p>
- As long as you are using a version of Google Chrome that supports
+ As long as you are using a version of Chrome that supports
extensions, you already have everything you need to start writing an
extension of your own.
You can start by turning on Developer mode.
@@ -93,8 +95,7 @@ try the
Click the wrench icon
<img src="images/toolsmenu.gif" height="29" width="29" alt=""
class="nomargin" />
- and select <b>Extensions</b> from the <b>Tools</b> menu
- (or from the <b>Window</b> menu on Mac).
+ and select <b>Extensions</b> from the <b>Tools</b> menu.
If there's a "+" next to "Developer mode",
click the "+" so it turns into a "-".
Now you can reload extensions,
@@ -112,14 +113,14 @@ try the
<h3 id="faq-dev-03">Can I use 3rd party web services in my extension?</h3>
<p>
- Yes. Google Chrome Extensions are capable of making cross-domain Ajax
- requests, so they can call remote APIs directly. APIs which provide data
+ Yes. Extensions are capable of making cross-domain Ajax
+ requests, so they can call remote APIs directly. APIs that provide data
in JSON format are particularly easy to use.
</p>
<h3 id="faq-dev-04">Can I use OAuth in my extensions?</h3>
<p>
- Absolutely, there are extensions which use OAuth to access remote data
+ Absolutely, there are extensions that use OAuth to access remote data
APIs. Most developers find it convenient to use a
<a href="http://unitedheroes.net/OAuthSimple/js/OAuthSimple.js">JavaScript OAuth library</a>
in order to simplify the process of signing OAuth requests.
@@ -130,7 +131,7 @@ try the
Extensions use HTML and CSS to define their user interfaces, so you can use
standard form controls to build your UI, or style the interface with CSS,
as you would a web page. Additionally, your extension may add buttons
- to the Google Chrome browser itself. See
+ to the Chrome browser itself. See
<a href="http://code.google.com/chrome/extensions/browserAction.html">browser actions</a>
and
<a href="http://code.google.com/chrome/extensions/pageAction.html">page actions</a>
@@ -142,12 +143,13 @@ try the
Yes, using the
<a href="http://code.google.com/chrome/extensions/trunk/npapi.html">NPAPI interface</a>.
Because of the possibility for abuse, though, we will review your extension
- before hosting it in the Google Chrome Extensions Gallery.
+ before hosting it in the Google Chrome Extensions Gallery
+ or Chrome Web Store.
</p>
-<h3 id="faq-dev-07">Can Google Chrome Extensions encode/decode JSON data?</h3>
+<h3 id="faq-dev-07">Can extensions encode/decode JSON data?</h3>
<p>
- Yes, because V8 (Google Chrome's JavaScript engine) supports
+ Yes, because V8 (Chrome's JavaScript engine) supports
JSON.stringify and JSON.parse natively, you may use these functions in your
extensions
<a href="http://json.org/js.html">as described here</a> without including
@@ -157,11 +159,11 @@ try the
<h3 id="faq-dev-08">Can I store data locally in my extension?</h3>
<p>
Yes, extensions can use <a href="http://dev.w3.org/html5/webstorage/">localStorage</a>
- to store string data permanently. Using Google Chrome's built-in JSON
+ to store string data permanently. Using Chrome's built-in JSON
functions, you can store complex data structures in localStorage. For
- extensions which have the need to execute SQL queries on their stored data,
- Google Chrome implements
- <a href="http://dev.w3.org/html5/webdatabase/">client side SQL databases</a>
+ extensions that need to execute SQL queries on their stored data,
+ Chrome implements
+ <a href="http://dev.w3.org/html5/webdatabase/">client side SQL databases</a>,
which may be used as well.
</p>
@@ -173,7 +175,7 @@ try the
<h3 id="faq-dev-10">Can I create an options menu for my application?</h3>
<p>
You can let users set options for your extension by creating an
- <a href="http://code.google.com/chrome/extensions/trunk/options.html">options page</a>
+ <a href="http://code.google.com/chrome/extensions/trunk/options.html">options page</a>,
which is a simple HTML page that will be loaded when a user clicks the
"options" button for your extension. This page can read and write settings
to localStorage, or even send options to a web server so that they can be
@@ -189,7 +191,7 @@ try the
<h3 id="faq-dev-12">What debugging tools are available to extension developers?</h3>
<p>
- Google Chrome's built-in developer tools can be used to debug extensions
+ Chrome's built-in developer tools can be used to debug extensions
as well as web pages. See this
<a href="http://code.google.com/chrome/extensions/tut_debugging.html ">tutorial on debugging extensions</a>
for more information.
@@ -205,9 +207,9 @@ try the
this.
</p>
-<h3 id="faq-dev-14">How do I determine which version of Google Chrome is deployed to which channel?</h3>
+<h3 id="faq-dev-14">How do I determine which version of Chrome is deployed to which channel?</h3>
<p>
- To determine which version of Google Chrome is currently available on each
+ To determine which version of Chrome is currently available on each
of the different platforms, visit
<a href="http://omahaproxy.appspot.com">omahaproxy.appspot.com</a>. On that
site you will see data in a format similar to:
@@ -233,7 +235,7 @@ win,stable,#.#.###.#,#.#.###.#</pre>
channels are <code>canary</code>, <code>dev</code>, <code>beta</code>,
and <code>stable</code>.
The two four-part numbers at the end of each line represent the range of
- versions of Google Chrome currently deployed to that platform-channel
+ versions of Chrome currently deployed to that platform-channel
combination.
</p>
@@ -289,7 +291,7 @@ win,stable,#.#.###.#,#.#.###.#</pre>
<p>
While developing an extension, you may find behavior that does not
match the extensions documentation and may be the result of a bug in
- Google Chrome. The best thing to do is to make sure an appropriate issue
+ Chrome. The best thing to do is to make sure an appropriate issue
report is filed, and the Chromium team has enough information to reproduce
the behavior.
</p>
@@ -312,8 +314,8 @@ win,stable,#.#.###.#,#.#.###.#</pre>
extensions are filed under <strong>Feature=Extensions</strong>, so to
look for an extension bug related to the
chrome.tabs.executeScript function (for example), search for
- "<code>Feature=Extensions Type=Bug chrome.tabs.executeScript</code>" which
- will give you
+ "<code>Feature=Extensions Type=Bug chrome.tabs.executeScript</code>",
+ which will give you
<a href="http://code.google.com/p/chromium/issues/list?can=2&q=Feature%3DExtensions+Type%3DBug+chrome.tabs.executeScript&colspec=ID+Stars+Pri+Area+Feature+Type+Status+Summary+Modified+Owner+Mstone+OS&x=mstone&y=area&cells=tiles">
this list of results</a>.
</li>
@@ -367,8 +369,8 @@ win,stable,#.#.###.#,#.#.###.#</pre>
extensions are filed under <strong>Feature=Extensions</strong>, so to
look for an extension feature request related to keyboard shortcuts
(for example), search
- for "<code>Feature=Extensions Type=Feature shortcuts</code>" which will
- give you
+ for "<code>Feature=Extensions Type=Feature shortcuts</code>",
+ which will give you
<a href="http://code.google.com/p/chromium/issues/list?can=2&q=Feature%3DExtensions+Type%3DFeature+shortcuts&colspec=ID+Stars+Pri+Area+Feature+Type+Status+Summary+Modified+Owner+Mstone+OS&x=mstone&y=area&cells=tiles">
this list of results</a>.
</li>
diff --git a/chrome/common/extensions/docs/static/getstarted.html b/chrome/common/extensions/docs/static/getstarted.html
index e1b907e..1121b58 100644
--- a/chrome/common/extensions/docs/static/getstarted.html
+++ b/chrome/common/extensions/docs/static/getstarted.html
@@ -162,8 +162,7 @@ Here are some suggestions for what to read next:
</li>
<li>
The <a href="hosting.html">hosting</a> page,
- which tells you about the gallery
- and other options for distributing your extension
+ which tells you about options for distributing your extension
</li>
</ul>
diff --git a/chrome/common/extensions/docs/static/hosting.html b/chrome/common/extensions/docs/static/hosting.html
index cacd261..5d00e41 100644
--- a/chrome/common/extensions/docs/static/hosting.html
+++ b/chrome/common/extensions/docs/static/hosting.html
@@ -1,122 +1,51 @@
<div id="pageData-name" class="pageData">Hosting</div>
-<div id="pageData-showTOC" class="pageData">true</div>
<p>
-Until the
-<a href="http://code.google.com/chrome/webstore/">Chrome Web Store</a>
-is available to the public,
-you can host your extension
-using the <a href="https://chrome.google.com/extensions">Extensions Gallery</a>.
-Once the store is public,
-the gallery's contents will be merged into the store.
-Another option
-is hosting your extension on other servers.
-</p>
-
-<p>
-This page gives tips for using the gallery,
-as well as details on how to host extensions on your own server.
-</p>
-
-<h2 id="gallery">Publishing to the Extensions Gallery</h2>
-
-<p>
-To publish extensions,
-you first need to pay a one-time
-<a href="http://blog.chromium.org/2010/08/security-improvements-and-registration.html">$5 developer registration fee</a>.
+This page tells you how to host <code>.crx</code> files
+on your own server.
+If you distribute your extension, app, or theme solely through the
+<a href="http://chrome.google.com/webstore">Chrome Web Store</a>,
+you don't need this page.
+Instead, consult the store help and
+<a href="http://code.google.com/chrome/webstore/index.html">developer documentation</a>.
+<!-- PENDING: add a link to the help -->
</p>
<p class="note">
-<b>Note:</b>
-If you used the Chrome Developer Dashboard before
-the first developer preview release of the Chrome Web Store &mdash;
-to publish an extension, for example &mdash;
-you don't need to pay the fee.
-</p>
-
-<p>
-Publishing to the gallery is easy,
-but your extension might be more popular
-if you take a little time to prepare:
-</p>
-
-<ul>
- <li> Visit the
- <a href="https://chrome.google.com/extensions">gallery</a>
- and look at similar extensions' pages.
- Your extension's page should look at least as good as theirs. </li>
- <li> Consider creating a support site for your extension,
- maybe a <a href="http://groups.google.com">Google Group</a>.
- If your extension's page has a link to your support site,
- people will be less likely to
- complain in the user comments. </li>
- <li> Consider creating a custom Gmail account
- for this extension or for all of your extensions.
- Only one account can upload, publish, and update your extension. </li>
- <li> Create some great text (titles and descriptions)
- and images (maybe even video) for your extension.
- See the
- <a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">gallery help</a>
- for details on screenshot and text requirements. </li>
-</ul>
-
-<p>
-To upload your extension,
-just zip up your extension's directory,
-go to the
-<a href="https://chrome.google.com/extensions/developer/dashboard">Developer Dashboard</a>,
-and add your extension.
-This creates a page for your extension,
-viewable only by you.
-Now you can edit your extension's page &mdash;
-uploading images, specifying text, and so on.
-</p>
-
-<p>
-Once you verify that your extension's page looks good
-and all links are valid,
-publish your extension.
+<strong>Note:</strong>
+If you've already published extensions to the
+<a href="https://chrome.google.com/extensions">Extensions Gallery</a>,
+they will be merged into the store.
</p>
<p>
-When you want to update your extension,
-use the dashboard to upload and publish the new version.
-Your users will automatically get the new version
-over the next few hours.
+By convention, extensions,
+installable web apps, and themes are served&mdash;whether
+by the Chrome Web Store or by a custom server&mdash;as
+<code>.crx</code> files.
+When you upload a ZIP file with the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
+the dashboard creates the <code>.crx</code> file for you.
</p>
-
-<h2 id="server">Hosting on your own server</h2>
-
<p>
-By convention, extensions are served &mdash;
-whether by the gallery or by a custom server &mdash;
-as <code>.crx</code> files.
-When you upload an extension to the gallery,
-the gallery creates the <code>.crx</code> file for you.
-If you aren't using the gallery,
+If you aren't publishing using the dashboard,
you need to create the <code>.crx</code> file yourself,
as described in <a href="packaging.html">Packaging</a>.
-</p>
-
-<p class="note">
-<b>Note:</b>
-If you do your own hosting,
-don't forget to set up
-<a href="autoupdate.html">autoupdate</a>,
-so you can be sure that
-your extension's users have the latest version.
+You can also specify
+<a href="autoupdate.html">autoupdate</a> information to ensure that
+your users will have the latest copy of the <code>.crx</code> file.
</p>
<p>
-A server that hosts extensions
+A server that hosts <code>.crx</code> files
must use appropriate HTTP headers,
-so that users can install your extension
+so that users can install the file
by clicking a link to it.
</p>
<p>
-Google Chrome considers a file to be an extension
+Google Chrome considers a file to be installable
if <b>either</b> of the following is true:
</p>
@@ -150,13 +79,13 @@ if <b>either</b> of the following is true:
</ul>
<p>
-The most common reason for failing to recognize an extension
+The most common reason for failing to recognize an installable file
is that the server sends the header
<code>X-Content-Type-Options: no sniff</code>.
The second most common reason
-is that the server sends an unknown content type &mdash;
-one that isn't in the previous list.
+is that the server sends an unknown content type&mdash;one
+that isn't in the previous list.
To fix an HTTP header issue,
either change the configuration of the server
-or try hosting the extension at another server.
+or try hosting the <code>.crx</code> file at another server.
</p>
diff --git a/chrome/common/extensions/docs/static/i18n.html b/chrome/common/extensions/docs/static/i18n.html
index c56abc6..4d0f9b3 100644
--- a/chrome/common/extensions/docs/static/i18n.html
+++ b/chrome/common/extensions/docs/static/i18n.html
@@ -509,10 +509,8 @@ LANGUAGE=es ./chrome
You can find simple examples of internationalization in the
<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/i18n/">examples/api/i18n</a>
directory.
-For a more complete example, see
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/news_i18n/">examples/extensions/news_i18n</a>
-(compare it to
-<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/news/">examples/extensions/news</a>).
+For a complete example, see
+<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/news/">examples/extensions/news</a>.
For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.
</p>
diff --git a/chrome/common/extensions/docs/static/index.html b/chrome/common/extensions/docs/static/index.html
index 7a1b6ab..07bfac5 100644
--- a/chrome/common/extensions/docs/static/index.html
+++ b/chrome/common/extensions/docs/static/index.html
@@ -20,100 +20,85 @@ cs {
<tr>
<td>
-<h3>What are Google Chrome Extensions?</h3>
+<h3>What are extensions?</h3>
<p>
-<em>Extensions</em> are small software programs
-that can modify and enhance the functionality of Google Chrome.
+Extensions are small software programs that
+can modify and enhance the functionality of the Chrome browser.
You write them using web technologies such as
HTML, JavaScript, and CSS.
+You can also use the extension system to build
+<a href="apps.html">packaged apps</a>,
+a downloadable kind of
+<a href="http://code.google.com/chrome/apps/index.html">installable web app</a>.
</p>
<p>
-Here are some examples of extensions:
+<img src="images/index/NEW/gmail.png" width="91" height="35"
+ align="right" style="margin-top:0px; margin-left:0.5em"
+ alt="A screenshot of an extension's icon in the browser bar" />
+From a user's point of view,
+extensions and packaged apps are very different
+because they present very different user interfaces.
+Extensions have little to no user interface.
+For example, the image to the right shows the icon
+that provides the UI for the
+<a href="samples.html#gmail">Gmail extension</a>.
</p>
-<table class="columns" id="pics">
-<tr>
- <td>
- <img src="images/index/gmail.png" width="150" height="79">
- </td>
- <td>
- <p>
- <b><a href="samples.html#gmail">Google Mail Checker</a></b><br>
- Uses a <em>browser action</em>
- (icon in the toolbar)
- to display how many unread messages
- are in your Gmail inbox.
- Click the icon to go to your inbox.
- </p>
- </td>
-</tr>
-
-<tr>
- <td>
- <img src="images/index/news.png" width="150" height="79">
- </td>
- <td>
- <p>
- <b><a href="samples.html#news">News Reader</a></b><br>
- Features a browser action that, when clicked,
- shows a popup summarizing the top news items.
- </p>
- </td>
-</tr>
-
-<tr>
- <td>
- <img src="images/index/rss.png" width="150" height="79">
- </td>
- <td>
- <p>
- <b><a href="samples.html#subscribe_page_action">Subscribe in Feed Reader</a></b><br>
- Uses a <em>page action</em>
- (icon in the address bar)
- and <em>content script</em>
- (code injected into a web page)
- to let you subscribe to a feed in the current web page.
- </p>
- </td>
-</tr>
-</table>
-<br />
+<p>
+<img src="images/index/html5app.png" width="200" height="160"
+ align="right" style="margin-top:0px; margin-left:0.5em"
+ alt="A screenshot of a packaged app that implements a jigsaw puzzle" />
+Packaged apps, on the other hand,
+look and feel like regular web apps,
+with a big-screen design
+and rich UI.
+The image to the right shows a jigsaw puzzle game
+implemented by a packaged app.
+</p>
<p>
-To keep up with the latest news on extensions, read the
-<a href="http://blog.chromium.org/">Chromium blog</a> and the
-<a href="http://chrome.blogspot.com/">Google Chrome blog</a>,
-and subscribe to the
-<a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">chromium-extensions group</a>.
+Both extensions and packaged apps bundle all their files
+into a single file that the user downloads and installs.
+This bundling means that, unlike ordinary web apps,
+extensions and packaged apps don't need to depend
+on content from the web.
+</p>
+<p>
+You can distribute your extension or packaged app
+by using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>
+to publish to the
+<a href="http://chrome.google.com/webstore">Chrome Web Store</a>.
+For more information, see the
+<a href="http://code.google.com/chrome/webstore">store developer documentation</a>.
</p>
</td>
-
<td style="width:330px">
<h3>How do I start?</h3>
<p>
<ol>
<li>
- Follow the
- <a href="getstarted.html">Getting Started tutorial</a>
+ Follow the <a href="getstarted.html">Getting Started tutorial</a>
+ <!-- PENDING: once we have one for packaged apps, change to
+ "for _extensions_ or _packaged_apps_" -->
</li>
<li>
Read the
<a href="overview.html">Overview</a>
</li>
<li>
- <a href="devguide.html">Write</a> and
- <a href="tut_debugging.html">debug</a>
- your extension
+ Keep up-to-date by reading the
+ <a href="http://blog.chromium.org/">Chromium blog</a>
</li>
<li>
- Submit your extension to the
- <a href="https://chrome.google.com/extensions">gallery</a>
- </li>
+ Subscribe to the
+ <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">chromium-extensions group</a>
+ </li>
</ol>
</p>
diff --git a/chrome/common/extensions/docs/static/manifest.html b/chrome/common/extensions/docs/static/manifest.html
index bbefe61..3f2f34e 100644
--- a/chrome/common/extensions/docs/static/manifest.html
+++ b/chrome/common/extensions/docs/static/manifest.html
@@ -2,10 +2,10 @@
<div id="pageData-showTOC" class="pageData">true</div>
<p>
-Every extension has a
+Every extension, installable web app, and theme has a
<a href="http://www.json.org">JSON</a>-formatted manifest file,
named <code>manifest.json</code>,
-that provides important information about the extension.
+that provides important information.
</p>
<h2 id="overview"> Field summary </h2>
@@ -13,7 +13,7 @@ that provides important information about the extension.
<p>
The following code shows the supported manifest fields,
with links to the page that discusses each field.
-The only fields that are required for every extension
+The only fields that are always required
are <b>name</b> and <b>version</b>.
</p>
@@ -32,6 +32,7 @@ are <b>name</b> and <b>version</b>.
"<a href="browserAction.html">browser_action</a>": {...},
"<a href="pageAction.html">page_action</a>": {...},
"<a href="themes.html">theme</a>": {...},
+ "<a href="#app">app</a>": {...},
<em>// Add any of these that you need</em>
"<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html",
@@ -41,6 +42,7 @@ are <b>name</b> and <b>version</b>.
"<a href="#incognito">incognito</a>": "spanning" <em>or</em> "split",
"<a href="#key">key</a>": "<em>publicKey</em>",
"<a href="#minimum_chrome_version">minimum_chrome_version</a>": "<em>versionString</em>",
+ "<a href="omnibox.html">omnibox</a>": { "keyword" : "<em>aString</em>" },
"<a href="options.html">options_page</a>": "<em>aFile</em>.html",
"<a href="#permissions">permissions</a>": [...],
"<a href="npapi.html">plugins</a>": [...],
@@ -58,6 +60,24 @@ with links to where they're described in detail,
see the <a href="#overview">Field summary</a>.
</p>
+
+<h3 id="app">app</h3>
+
+<p>
+Used by installable web apps,
+including packaged apps,
+to specify the URLs that the app uses.
+Most important is the <em>launch page</em> for the app&mdash;the
+page that the browser goes to when the user clicks the app's icon
+in the New Tab page.
+</p>
+
+<p>
+For details, see the documentation for
+<a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted apps</a> and
+<a href="apps.html">packaged apps</a>.
+</p>
+
<h3 id="default_locale">default_locale</h3>
<p>
@@ -80,7 +100,7 @@ no more than 132 characters)
that describes the extension.
The description should be suitable for both
the browser's extension management UI
-and the <a href="https://chrome.google.com/extensions">extension gallery</a>.
+and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>.
You can specify locale-specific strings for this field;
see <a href="i18n.html">Internationalization</a> for details.
</p>
@@ -91,22 +111,23 @@ see <a href="i18n.html">Internationalization</a> for details.
The URL of the homepage for this extension. The extensions management page (chrome://extensions)
will contain a link to this URL. This field is particularly useful if you
<a href="hosting.html">host the extension on your own site</a>. If you distribute your
-extension using the <a href="http://chrome.google.com/extensions">gallery</a>,
+extension using the <a href="https://chrome.google.com/extensions">Extensions Gallery</a>,
the homepage URL defaults to the extension's own gallery page.
+<!-- PENDING: check whether the same is true of the store -->
</p>
<h3 id="icons">icons</h3>
<p>
-One or more icons that represent the extension.
-You should provide icons in at least two sizes &mdash;
-48x48 and 128x128 pixels.
-The 48x48 icon is used in the extensions management page
+One or more icons that represent the extension, app, or theme.
+You should always provide a 128x128 icon;
+it's used during installation and by the Chrome Web Store.
+Extensions should also provide a 48x48 icon,
+which is used in the extensions management page
(chrome://extensions).
-The 128x128 icon is used when the user installs the extension.
You can also specify a 16x16 icon to be used as the favicon
-for the extension's pages.
-The 16x16 icon is also displayed in the experimental
+for an extension's pages.
+The 16x16 icon is also displayed in the experimental extension
<a href="experimental.infobars.html">infobar</a>
feature.
</p>
@@ -126,28 +147,28 @@ Here's an example of specifying the icons:
</pre>
<p class="note">
-<b>Note:</b>
+<b>Important:</b>
Use only the documented icon sizes.
<br><br>
-You may notice that Google Chrome sometimes resizes these icons down to smaller
-sizes. For example, as of this writing, the install dialog shrinks the 128-pixel
+You might notice that Chrome sometimes resizes these icons down to smaller
+sizes. For example, the install dialog might shrink the 128-pixel
icon down to 69 pixels.
<br><br>
-Nevertheless, you should use only the documented sizes. The details of Google
-Chrome's UI may change between versions. These changes are made assuming that
-extension developers are using the documented sizes. If you use other sizes,
+However, the details of
+Chrome's UI may change between versions, and these changes assume that
+developers are using the documented sizes. If you use other sizes,
your icon may look bad in future versions of the browser.
</p>
<p>
-If you submit your extension to the
-<a href="https://chrome.google.com/extensions">gallery</a>,
+If you upload your extension, app, or theme using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
you'll need to upload additional images,
-including a 32x32-pixel logo
-and at least one screenshot of your extension.
-For more information on gallery requirements,
+including at least one screenshot of your extension.
+For more information,
see the
-<a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">gallery help</a>.
+<a href="http://code.google.com/chrome/webstore/">Chrome Web Store
+developer documentation</a>.
</p>
<h3 id="incognito">incognito</h3>
@@ -185,12 +206,12 @@ incognito behavior.
<p>
This value can be used to control
-the unique ID of an extension when
+the unique ID of an extension, app, or theme when
it is loaded during development.
</p>
<p class="note">
-<b>Note:</b> Most extensions should not need to
+<b>Note:</b> You don't usually need to
use this value. Instead, write your
code so that the key value doesn't matter
by using <a href="overview.html#relative-urls">relative paths</a>
@@ -201,7 +222,7 @@ and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>.
To get a suitable key value, first
install your extension from a <code>.crx</code> file
(you may need to
-<a href="hosting.html#gallery">upload your extension to the gallery</a>,
+<a href="https://chrome.google.com/webstore/developer/dashboard">upload your extension</a>
or <a href="packaging.html">package it manually</a>).
Then, in your
<a href="http://www.chromium.org/user-experience/user-data-directory">user
@@ -213,7 +234,7 @@ You will see the key value filled in there.
<h3 id="minimum_chrome_version">minimum_chrome_version</h3>
<p>
-The version of Google Chrome that your extension requires, if any.
+The version of Chrome that your extension, app, or theme requires, if any.
The format for this string is the same as for the
<a href="#version">version</a> field.
@@ -225,7 +246,7 @@ A short, plain text string
that identifies the extension.
The name is used in the install dialog,
extension management UI,
-and the <a href="https://chrome.google.com/extensions">extension gallery</a>.
+and the <a href="https://chrome.google.com/webstore">store</a>.
You can specify locale-specific strings for this field;
see <a href="i18n.html">Internationalization</a> for details.
</p>
@@ -233,18 +254,20 @@ see <a href="i18n.html">Internationalization</a> for details.
<h3 id="permissions">permissions</h3>
<p>
-An array of permissions that the extension might use.
+An array of permissions that the extension or app might use.
Each permission can be either one of a list of known strings
-(such as "tabs")
+(such as "geolocation")
or a match pattern
that gives access to one or more hosts.
-These permissions are displayed to users before installation.
-Permissions might also help to limit damage
-if your extension is attacked.
+Permissions can help to limit damage
+if your extension or app is attacked.
+Some permissions are also displayed to users before installation,
+as detailed in
+<a href="permission_warnings.html">Permission Warnings</a>.
</p>
<p>
-If an API requires you to declare a permission in the manifest,
+If an extension API requires you to declare a permission in the manifest,
then its documentation tells you how to do so.
For example,
the <a href="tabs.html">Tabs</a> page
@@ -253,7 +276,8 @@ declare the "tabs" permission.
</p>
<p>
-Here's an example of the permissions part of a manifest file:
+Here's an example of the permissions part of a manifest file
+for an extension:
</p>
<pre>
@@ -267,7 +291,15 @@ Here's an example of the permissions part of a manifest file:
</pre>
<p>
-The following table lists the permissions an extension can use.
+The following table lists the permissions an extension
+or packaged app can use.
+</p>
+
+<p class="note">
+<strong>Note:</strong>
+Hosted apps can use the
+"geolocation", "notifications", and "unlimitedStorage" permissions,
+but not any other permissions listed in this table.
</p>
<table>
@@ -422,4 +454,4 @@ For more information, see
<a href="autoupdate.html">Autoupdating</a>.
</p>
-<!-- [PENDING: Possibly: point to the gallery and make a big deal of the fact that autoupdating is free if you use the gallery.] -->
+<!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the fact that autoupdating is free if you use them.] -->
diff --git a/chrome/common/extensions/docs/static/experimental.omnibox.html b/chrome/common/extensions/docs/static/omnibox.html
index c757b77..422c9cf 100644
--- a/chrome/common/extensions/docs/static/experimental.omnibox.html
+++ b/chrome/common/extensions/docs/static/omnibox.html
@@ -1,3 +1,5 @@
+<div id="pageData-name" class="pageData">Omnibox</div>
+
<!-- BEGIN AUTHORED CONTENT -->
<p>
The omnibox API allows you to register a
@@ -6,7 +8,7 @@ which is also known as the omnibox.
</p>
<p>
-<img src="images/omnibox.png" width="480" height="300"
+<img src="images/omnibox.png" width="300" height="150"
alt="A screenshot showing suggestions related to the keyword 'Chromium Search'"/>
</p>
@@ -31,11 +33,12 @@ and can take action.
<h2 id="manifest">Manifest</h2>
<p>
-To use the omnibox API, your manifest must
-declare the "experimental" permission and
-specify an <code>omnibox_keyword</code> field. You should also
+You must include an <code>omnibox</code> <code>keyword</code> field
+in the <a href="manifest.html">manifest</a>
+to use the omnibox API.
+You should also
specify a 16x16-pixel icon, which will be
-displayed in the omnibox when suggesting users
+displayed in the address bar when suggesting that users
enter keyword mode.
</p>
@@ -46,22 +49,23 @@ For example:
<pre>{
"name": "Aaron's omnibox extension",
"version": "1.0",
- <b>"permissions": ["experimental"],</b>
- <b>"omnibox_keyword": "aaron",</b>
+ <b>"omnibox": { "keyword" : "aaron" },</b>
<b>"icons": {</b>
<b>"16": "16-full-color.png"</b>
<b>},</b>
"background_page": "background.html"
}</pre>
-<p><b class="note">Note:</b> Google Chrome
-automatically creates a greyscale version of
+<p class="note">
+<strong>Note:</strong>
+Chrome automatically creates a grayscale version of
your 16x16-pixel icon. You should provide
a full-color version so that it can also be
used in other situations that require color.
For example, the <a href="contextMenus.html"
>context menus API</a> also uses a 16x16-pixel
icon, but it is displayed in color.
+</p>
<h2 id="examples">Examples</h2>
diff --git a/chrome/common/extensions/docs/static/overview.html b/chrome/common/extensions/docs/static/overview.html
index 6996c2f..98ab568 100644
--- a/chrome/common/extensions/docs/static/overview.html
+++ b/chrome/common/extensions/docs/static/overview.html
@@ -5,16 +5,22 @@
Once you've finished this page
and the
<a href="getstarted.html">Getting Started</a> tutorial,
-you'll be all set to start writing extensions.
+you'll be all set to start writing extensions and packaged apps.
</p>
+<p class="caution">
+<strong>Note:</strong>
+<em>Packaged apps</em> are implemented as extensions,
+so unless otherwise stated,
+everything in this page applies to packaged apps.
+</p>
<h2 id="what">The basics</h2>
<p>
-An extension is a zipped bundle of files &mdash;
-HTML, CSS, JavaScript, images, and anything else you need &mdash;
-that adds functionality to the Google Chrome browser.
+An extension is a zipped bundle of files&mdash;HTML,
+CSS, JavaScript, images, and anything else you need&mdash;that
+adds functionality to the Google Chrome browser.
Extensions are essentially web pages,
and they can use all the
<a href="api_other.html">APIs that the browser provides to web pages</a>,
@@ -22,22 +28,22 @@ from XMLHttpRequest to JSON to HTML5.
</p>
<p>
-Many extensions add UI to Google Chrome,
-in the form of
-<a href="browserAction.html">browser actions</a>
-or <a href="pageAction.html">page actions</a>.
+Extensions can interact with web pages or servers using
+<a href="content_scripts.html">content scripts</a> or
+<a href="xhr.html">cross-origin XMLHttpRequests</a>.
Extensions can also interact programmatically
with browser features such as
<a href="bookmarks.html">bookmarks</a>
and <a href="tabs.html">tabs</a>.
-To interact with web pages or servers,
-extensions can use
-<a href="content_scripts.html">content scripts</a> or
-<a href="xhr.html">cross-origin XMLHttpRequests</a>.
</p>
+<h3 id="extension-ui">Extension UIs</h3>
+
<p>
-<b>Note:</b>
+Many extensions&mdash;but not packaged apps&mdash;add
+UI to Google Chrome in the form of
+<a href="browserAction.html">browser actions</a>
+or <a href="pageAction.html">page actions</a>.
Each extension can have at most one browser action or page action.
Choose a <b>browser action</b> when the extension is relevant to most pages.
Choose a <b>page action</b> when the extension's icon
@@ -45,13 +51,77 @@ should appear or disappear,
depending on the page.
</p>
+<table class="columns">
+<tr>
+ <td>
+ <img src="images/index/gmail.png"
+ width="150" height="79"
+ alt="screenshot" />
+ </td>
+ <td>
+ <img src="images/index/news.png"
+ width="150" height="79"
+ alt="screenshot" />
+ </td>
+ <td>
+ <img src="images/index/rss.png"
+ width="150" height="79"
+ alt="screenshot" />
+ </td>
+</tr>
+
+<tr>
+ <td>
+ This <a href="samples.html#gmail">mail extension</a>
+ uses a <em>browser action</em>
+ (icon in the toolbar).
+ </td>
+ <td>
+ This <a href="samples.html#news">news reader extension</a>
+ features a browser action that,
+ when clicked,
+ shows a <em>popup</em>.
+ </td>
+ <td>
+ This <a href="samples.html#mappy">map extension</a>
+ uses a <em>page action</em>
+ (icon in the address bar)
+ and <em>content script</em>
+ (code injected into a web page).
+ </td>
+</tr>
+</table>
+
<p>
+Extensions (and packaged apps) can also present a UI in other ways,
+such as adding to the Chrome context menu,
+providing an options page,
+or using a content script that changes how pages look.
See the <a href="devguide.html">Developer's Guide</a>
for a complete list of extension features,
-with implementation details
+with links to implementation details
for each one.
</p>
+
+<h3 id="packagedapp-ui">Packaged app UIs</h3>
+
+<p>
+A packaged app usually presents its main functionality using
+an HTML page that's bundled into the app.
+For example, the following packaged app
+displays a Flash file within an HTML page.
+</p>
+
+<img src="images/index/flashapp.png"
+ width="372" height="300"
+ alt="screenshot" />
+
+<p>
+For more information,
+see <a href="apps.html">Packaged Apps</a>.
+</p>
+
<h2 id="files">Files</h2>
<p>
Each extension has the following files:
@@ -62,8 +132,8 @@ Each extension has the following files:
<li>A <b>manifest file</b></li>
<li>One or more <b>HTML files</b> (unless the extension is a theme)</li>
<li><em>Optional:</em> One or more <b>JavaScript files</b></li>
- <li><em>Optional:</em> Any other files your extension needs &mdash;
- for example, image files</li>
+ <li><em>Optional:</em> Any other files your extension needs&mdash;for
+ example, image files</li>
</ul>
<p>
@@ -72,8 +142,9 @@ you put all these files into a single folder.
When you distribute your extension,
the contents of the folder are packaged into a special ZIP file
that has a <code>.crx</code> suffix.
-If you put your extension in the gallery,
-the gallery creates the <code>.crx</code> file for you.
+If you upload your extension using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
+the <code>.crx</code> file is created for you.
For details on distributing extensions,
see <a href="hosting.html">Hosting</a>.
</p>
@@ -309,10 +380,11 @@ or by making server requests that result in saving data.
Whenever you want to save something,
first consider whether it's
from a window that's in incognito mode.
-By default, extensions don't run in incognito windows.
-However, users can selectively enable your extension for incognito mode,
-so you need to consider what a user expects
-from your extension in that case.
+By default, extensions don't run in incognito windows,
+and packaged apps <em>do</em>.
+You need to consider what a user expects
+from your extension or packaged app
+when the browser is incognito.
</p>
<p>
diff --git a/chrome/common/extensions/docs/static/packaging.html b/chrome/common/extensions/docs/static/packaging.html
index bf2dbc6..1cb1f53 100644
--- a/chrome/common/extensions/docs/static/packaging.html
+++ b/chrome/common/extensions/docs/static/packaging.html
@@ -13,7 +13,7 @@ for example, <code>myextension.crx</code>.
<b>Note:</b>
You might not need to package your extension.
If you publish your extension using the
-<a href="https://chrome.google.com/extensions">gallery</a>,
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
then the only reason to create your own <code>.crx</code> file
would be to distribute a non-public version &mdash;
for example, to alpha testers.
@@ -79,8 +79,8 @@ You'll need it later if you want to do any of the following:
</p>
<ul>
<li><a href="#update">Update</a> the extension</li>
-<li>Upload the extension to the
-<a href="https://chrome.google.com/extensions">Extensions Gallery</a> </li>
+<li>Upload the extension using the
+<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a></li>
</ul>
<p>
@@ -159,4 +159,4 @@ add <code>--no-message-box</code> to the command.
<p>
For more information on the format, as well as pointers to scripts you can use
to create <code>.crx</code> files, see <a href="crx.html">CRX package format</a>.
-</p> \ No newline at end of file
+</p>
diff --git a/chrome/common/extensions/docs/static/pageAction.html b/chrome/common/extensions/docs/static/pageAction.html
index 0c515b9..3def87e 100644
--- a/chrome/common/extensions/docs/static/pageAction.html
+++ b/chrome/common/extensions/docs/static/pageAction.html
@@ -28,6 +28,11 @@ If you want the extension's icon to always be visible,
use a <a href="browserAction.html">browser action</a> instead.
</p>
+<p class="caution">
+<strong>Note:</strong>
+Packaged apps cannot use page actions.
+</p>
+
<h2 id="manifest">Manifest</h2>
diff --git a/chrome/common/extensions/docs/static/permission_warnings.html b/chrome/common/extensions/docs/static/permission_warnings.html
index eea6558..4671f58 100644
--- a/chrome/common/extensions/docs/static/permission_warnings.html
+++ b/chrome/common/extensions/docs/static/permission_warnings.html
@@ -1,9 +1,21 @@
<div id="pageData-name" class="pageData">Permission Warnings</div>
<div id="pageData-showTOC" class="pageData">true</div>
+<!--
+NOTE: When this doc is updated, the online help should also be updated:
+http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=186213
+
+We should periodically look at
+http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?view=markup
+to make sure that we're covering all messages. Search for
+IDS_EXTENSION_PROMPT_WARNING
+(e.g. IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY).
+-->
+
<p>
To use most chrome.* APIs and extension capabilities,
-your extension must declare its intent in the manifest,
+your extension must declare its intent in the
+<a href="manifest.html">manifest</a>,
often in the "permissions" field.
Some of these declarations
result in a warning when
@@ -28,8 +40,8 @@ that a user might see when installing an extension:
</p>
<img src="images/perms-hw1.png"
- width="387" height="162"
- alt="Permission warning: 'This extension can access: Your data on api.flickr.com'"
+ width="410" height="193"
+ alt="Permission warning: 'It can access: Your data on api.flickr.com'"
/>
<p>
@@ -87,8 +99,8 @@ brings up the following warning:
</p>
<img src="images/perms-hw2.png"
- width="387" height="190"
- alt="Permission warning: 'This extension can access: Your data on api.flickr.com and flickr.com; Your browsing history'"
+ width="412" height="220"
+ alt="Permission warning: 'It can access: Your data on api.flickr.com and flickr.com; Your browsing history'"
/>
@@ -100,8 +112,7 @@ results in the seemingly unrelated warning
that the extension can access your browsing history.
The reason for the warning is that
although the <code>chrome.tabs</code> API
-might be used only to open new tabs
-(<a href="tabs.html#method-create"><code>chrome.tabs.create()</code></a>),
+might be used only to open new tabs,
it can also be used to see the URL that's associated
with every newly opened tab
(using their <a href="tabs.html#type-Tab">Tab</a> objects).
@@ -111,13 +122,14 @@ with every newly opened tab
<b>Note:</b>
As of Google Chrome 7,
you no longer need to specify the "tabs" permission
-just to call <code>chrome.tabs.create()</code>.
+just to call <code>chrome.tabs.create()</code>
+or <code>chrome.tabs.update()</code>.
</p>
<p>
The following table lists the warning messages
that users can see,
-along with the <a href="manifest.html">manifest</a> entries
+along with the manifest entries
that trigger them.
</p>
@@ -129,7 +141,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_FULL_ACCESS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS -->
All data on your computer and the websites you visit
</td>
<td>
@@ -143,7 +155,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_BOOKMARKS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS -->
Your bookmarks
</td>
<td>
@@ -157,7 +169,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY -->
Your browsing history
</td>
<td>
@@ -184,7 +196,7 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_ALL_HOSTS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS -->
Your data on all websites
</td>
<td>
@@ -217,8 +229,8 @@ that trigger them.
</tr>
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_?_HOST -->
- <!-- IDS_EXTENSION_PROMPT2_WARNING_4_OR_MORE_HOSTS -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_?_HOST -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_4_OR_MORE_HOSTS -->
Your data on <em>{list of websites}</em>
</td>
<td>
@@ -251,7 +263,29 @@ that trigger them.
<tr>
<td style="font-weight:bold">
- <!-- IDS_EXTENSION_PROMPT2_WARNING_GEOLOCATION -->
+ <!-- IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT -->
+ Your list of installed apps, extensions, and themes
+ <br />
+ <span style="font-weight:normal; font-style:italic">or</span>
+ <br />
+ Manage themes, extensions, and apps
+
+ <!-- PENDING: remove "Manage...apps" alternative message
+ once the fix is out on stable channel -->
+ <!-- See http://crbug.com/67859 -->
+ </td>
+ <td>
+ "management" permission
+ </td>
+ <td>
+ The "management" permission is required by the
+ <a href="management.html"><code>chrome.management</code></a> module.
+ </td>
+</tr>
+
+<tr>
+ <td style="font-weight:bold">
+ <!-- IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION -->
Your physical location
</td>
<td>
diff --git a/chrome/common/extensions/docs/static/tabs.html b/chrome/common/extensions/docs/static/tabs.html
index 9d90556..df0c8c1 100644
--- a/chrome/common/extensions/docs/static/tabs.html
+++ b/chrome/common/extensions/docs/static/tabs.html
@@ -12,7 +12,10 @@ create, modify, and rearrange tabs in the browser.
width="323" height="50" alt="Two tabs in a window" />
<h2 id="manifest">Manifest</h2>
-<p>All but two functions* require you to declare the "tabs" permission in your extension's manifest to use the tabs API.
+<p>
+Almost all <code>chrome.tabs</code> methods require you to
+declare the "tabs" permission
+in the <a href="manifest.html">extension manifest</a>.
For example:
</p>
@@ -25,7 +28,13 @@ For example:
...
}</pre>
-<p>* The two functions that do not require the "tabs" permission are: tabs.create and tabs.update</p>
+<p>
+The two methods that don't require the "tabs" permission are
+<a href="#method-create"><code>create</code></a> and
+<a href="#method-update"><code>update</code></a>.
+</p>
+
+
<h2 id="examples"> Examples </h2>
<p>
diff --git a/chrome/common/extensions/docs/static/tut_analytics.html b/chrome/common/extensions/docs/static/tut_analytics.html
index 7cecf51..f1a8bc1 100644
--- a/chrome/common/extensions/docs/static/tut_analytics.html
+++ b/chrome/common/extensions/docs/static/tut_analytics.html
@@ -187,7 +187,7 @@ extension.</p>
<p>
For more information about using the event tracking API, see the
Google Analytics
- <a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerOverview.html]">developer
+ <a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerOverview.html">developer
documentation</a>.
</p>
diff --git a/chrome/common/extensions/docs/static/whats_new.html b/chrome/common/extensions/docs/static/whats_new.html
index fd7560f..9896ce7 100644
--- a/chrome/common/extensions/docs/static/whats_new.html
+++ b/chrome/common/extensions/docs/static/whats_new.html
@@ -7,12 +7,21 @@ made in recent releases.
</p>
<ul>
+ <li> <a href="#8">Google Chrome 8</a> </li>
<li> <a href="#7">Google Chrome 7</a> </li>
<li> <a href="#6">Google Chrome 6</a> </li>
</ul>
-<h2 name="7"> Google Chrome 7 </h2>
+<h2 id="8"> Google Chrome 8 </h2>
+
+<p>
+We took a break for Chrome 8.
+No API or manifest changes worth noting.
+</p>
+
+
+<h2 id="7"> Google Chrome 7 </h2>
<h4> New APIs </h4>
<ul>
@@ -51,7 +60,7 @@ made in recent releases.
-->
-<h2 name="6">Google Chrome 6</h2>
+<h2 id="6">Google Chrome 6</h2>
<h4> New APIs </h4>
<ul>
diff --git a/chrome/common/extensions/docs/static/xhr.html b/chrome/common/extensions/docs/static/xhr.html
index a7be123..84cecfc 100644
--- a/chrome/common/extensions/docs/static/xhr.html
+++ b/chrome/common/extensions/docs/static/xhr.html
@@ -36,12 +36,6 @@ xhr.open("GET", chrome.extension.getURL('/config_resources/config.json'), true);
xhr.send();
</pre>
-<p class="caution">
-<b>Bug note:</b>
-Until <a href="http://crbug.com/41024">bug 41024</a> is fixed,
-the preceding code won't work.
-</p>
-
<p>If the extension attempts to use a security origin other than itself,
say http://www.google.com,
the browser disallows it
diff --git a/chrome/common/extensions/docs/tabs.html b/chrome/common/extensions/docs/tabs.html
index 1ffe88d..cf7d2f6 100644
--- a/chrome/common/extensions/docs/tabs.html
+++ b/chrome/common/extensions/docs/tabs.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -359,7 +360,10 @@ create, modify, and rearrange tabs in the browser.
<img src="images/tabs.png" width="323" height="50" alt="Two tabs in a window">
<h2 id="manifest">Manifest</h2>
-<p>All but two functions* require you to declare the "tabs" permission in your extension's manifest to use the tabs API.
+<p>
+Almost all <code>chrome.tabs</code> methods require you to
+declare the "tabs" permission
+in the <a href="manifest.html">extension manifest</a>.
For example:
</p>
@@ -372,7 +376,13 @@ For example:
...
}</pre>
-<p>* The two functions that do not require the "tabs" permission are: tabs.create and tabs.update</p>
+<p>
+The two methods that don't require the "tabs" permission are
+<a href="#method-create"><code>create</code></a> and
+<a href="#method-update"><code>update</code></a>.
+</p>
+
+
<h2 id="examples"> Examples </h2>
<p>
diff --git a/chrome/common/extensions/docs/template/api_template.html b/chrome/common/extensions/docs/template/api_template.html
index a1afec6..b495e8d 100644
--- a/chrome/common/extensions/docs/template/api_template.html
+++ b/chrome/common/extensions/docs/template/api_template.html
@@ -152,10 +152,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -189,6 +189,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -202,9 +203,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -214,7 +215,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/themes.html b/chrome/common/extensions/docs/themes.html
index eff32c2..b488a9d 100644
--- a/chrome/common/extensions/docs/themes.html
+++ b/chrome/common/extensions/docs/themes.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li class="leftNavSelected">Themes</li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,8 +229,8 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
- <li><a href="themes.html">Themes</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
+ <li class="leftNavSelected">Themes</li>
</ul>
</li>
</ul>
diff --git a/chrome/common/extensions/docs/tut_analytics.html b/chrome/common/extensions/docs/tut_analytics.html
index 90a7006..d6a070f 100644
--- a/chrome/common/extensions/docs/tut_analytics.html
+++ b/chrome/common/extensions/docs/tut_analytics.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -512,7 +513,7 @@ extension.</p>
<p>
For more information about using the event tracking API, see the
Google Analytics
- <a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerOverview.html]">developer
+ <a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerOverview.html">developer
documentation</a>.
</p>
diff --git a/chrome/common/extensions/docs/tut_debugging.html b/chrome/common/extensions/docs/tut_debugging.html
index aa399ae..64a4ae1 100644
--- a/chrome/common/extensions/docs/tut_debugging.html
+++ b/chrome/common/extensions/docs/tut_debugging.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li class="leftNavSelected">Debugging</li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/tut_oauth.html b/chrome/common/extensions/docs/tut_oauth.html
index 0057664..1783eda 100644
--- a/chrome/common/extensions/docs/tut_oauth.html
+++ b/chrome/common/extensions/docs/tut_oauth.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/tutorials.html b/chrome/common/extensions/docs/tutorials.html
index 5d63ce7..b88a9cf 100644
--- a/chrome/common/extensions/docs/tutorials.html
+++ b/chrome/common/extensions/docs/tutorials.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/whats_new.html b/chrome/common/extensions/docs/whats_new.html
index a632e7c..5b644f7 100644
--- a/chrome/common/extensions/docs/whats_new.html
+++ b/chrome/common/extensions/docs/whats_new.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -310,12 +311,21 @@ made in recent releases.
</p>
<ul>
+ <li> <a href="#8">Google Chrome 8</a> </li>
<li> <a href="#7">Google Chrome 7</a> </li>
<li> <a href="#6">Google Chrome 6</a> </li>
</ul>
-<h2 name="7"> Google Chrome 7 </h2>
+<h2 id="8"> Google Chrome 8 </h2>
+
+<p>
+We took a break for Chrome 8.
+No API or manifest changes worth noting.
+</p>
+
+
+<h2 id="7"> Google Chrome 7 </h2>
<h4> New APIs </h4>
<ul>
@@ -354,7 +364,7 @@ made in recent releases.
-->
-<h2 name="6">Google Chrome 6</h2>
+<h2 id="6">Google Chrome 6</h2>
<h4> New APIs </h4>
<ul>
diff --git a/chrome/common/extensions/docs/windows.html b/chrome/common/extensions/docs/windows.html
index cd6d078..f821c30 100644
--- a/chrome/common/extensions/docs/windows.html
+++ b/chrome/common/extensions/docs/windows.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
diff --git a/chrome/common/extensions/docs/xhr.html b/chrome/common/extensions/docs/xhr.html
index d3c32e2..b76acc5 100644
--- a/chrome/common/extensions/docs/xhr.html
+++ b/chrome/common/extensions/docs/xhr.html
@@ -166,10 +166,10 @@
<li><a href="browserAction.html">Browser Actions</a></li>
<li><a href="contextMenus.html">Context Menus</a></li>
<li><a href="notifications.html">Desktop Notifications</a></li>
+ <li><a href="omnibox.html">Omnibox</a></li>
<li><a href="options.html">Options Pages</a></li>
<li><a href="override.html">Override Pages</a></li>
<li><a href="pageAction.html">Page Actions</a></li>
- <li><a href="themes.html">Themes</a></li>
</ul>
</li>
<li>Browser Interaction
@@ -203,6 +203,7 @@
</li>
</ul>
</li>
+ <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
<li><h2><a href="tutorials.html">Tutorials</a></h2>
<ul>
<li><a href="tut_debugging.html">Debugging</a></li>
@@ -216,9 +217,9 @@
<ul>
<li><a href="manifest.html">Manifest Files</a></li>
<li><a href="match_patterns.html">Match Patterns</a></li>
- <!-- <li>Packages (.crx)</li> -->
</ul>
</li>
+ <li><a href="permission_warnings.html">Permission Warnings</a></li>
<li><a href="api_index.html">chrome.* APIs</a></li>
<li><a href="api_other.html">Other APIs</a></li>
</ul>
@@ -228,7 +229,7 @@
<li><h2>More</h2>
<ul>
<li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li>
- <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Installable Web Apps</a></li>
+ <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
<li><a href="themes.html">Themes</a></li>
</ul>
</li>
@@ -338,12 +339,6 @@ xhr.open("GET", chrome.extension.getURL('/config_resources/config.json'), true);
xhr.send();
</pre>
-<p class="caution">
-<b>Bug note:</b>
-Until <a href="http://crbug.com/41024">bug 41024</a> is fixed,
-the preceding code won't work.
-</p>
-
<p>If the extension attempts to use a security origin other than itself,
say http://www.google.com,
the browser disallows it
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 4d33822..c49399a 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -71,9 +71,6 @@ static void ConvertHexadecimalToIDAlphabet(std::string* id) {
}
}
-const int kValidWebExtentSchemes =
- URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS;
-
// These keys are allowed by all crx files (apps, extensions, themes, etc).
static const char* kBaseCrxKeys[] = {
keys::kCurrentLocale,
@@ -250,6 +247,13 @@ const size_t Extension::kNumHostedAppPermissions =
// We purposefully don't put this into kPermissionNames.
const char Extension::kOldUnlimitedStoragePermission[] = "unlimited_storage";
+const int Extension::kValidWebExtentSchemes =
+ URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS;
+
+const int Extension::kValidHostPermissionSchemes =
+ (UserScript::kValidUserScriptSchemes |
+ URLPattern::SCHEME_CHROMEUI) & ~URLPattern::SCHEME_FILE;
+
//
// Extension
//
@@ -266,6 +270,22 @@ scoped_refptr<Extension> Extension::Create(const FilePath& path,
return extension;
}
+namespace {
+const char* kGalleryUpdateHttpUrl =
+ "http://clients2.google.com/service/update2/crx";
+const char* kGalleryUpdateHttpsUrl =
+ "https://clients2.google.com/service/update2/crx";
+} // namespace
+
+// static
+GURL Extension::GalleryUpdateUrl(bool secure) {
+ CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL))
+ return GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL));
+ else
+ return GURL(secure ? kGalleryUpdateHttpsUrl : kGalleryUpdateHttpUrl);
+}
+
// static
int Extension::GetPermissionMessageId(const std::string& permission) {
return ExtensionConfig::GetSingleton()->GetPermissionMessageId(permission);
@@ -300,20 +320,47 @@ std::set<string16> Extension::GetSimplePermissionMessages() const {
return messages;
}
-std::vector<std::string> Extension::GetDistinctHosts() const {
- return GetDistinctHosts(GetEffectiveHostPermissions().patterns());
+// static
+std::vector<std::string> Extension::GetDistinctHostsForDisplay(
+ const URLPatternList& list) {
+ return GetDistinctHosts(list, true);
}
// static
-std::vector<std::string> Extension::GetDistinctHosts(
- const URLPatternList& host_patterns) {
+bool Extension::IsElevatedHostList(
+ const URLPatternList& old_list, const URLPatternList& new_list) {
+ // TODO(jstritar): This is overly conservative with respect to subdomains.
+ // For example, going from *.google.com to www.google.com will be
+ // considered an elevation, even though it is not (http://crbug.com/65337).
+
+ std::vector<std::string> new_hosts = GetDistinctHosts(new_list, false);
+ std::vector<std::string> old_hosts = GetDistinctHosts(old_list, false);
+ std::set<std::string> old_hosts_set(old_hosts.begin(), old_hosts.end());
+ std::set<std::string> new_hosts_set(new_hosts.begin(), new_hosts.end());
+ std::set<std::string> new_hosts_only;
+
+ std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
+ old_hosts_set.begin(), old_hosts_set.end(),
+ std::inserter(new_hosts_only, new_hosts_only.begin()));
+
+ return new_hosts_only.size() > 0;
+}
+
+// static
+std::vector<std::string> Extension::GetDistinctHosts(
+ const URLPatternList& host_patterns, bool include_rcd) {
// Vector because we later want to access these by index.
std::vector<std::string> distinct_hosts;
std::set<std::string> rcd_set;
for (size_t i = 0; i < host_patterns.size(); ++i) {
std::string candidate = host_patterns[i].host();
+
+ // Add the subdomain wildcard back to the host, if necessary.
+ if (host_patterns[i].match_subdomains())
+ candidate = "*." + candidate;
+
size_t registry = net::RegistryControlledDomainService::GetRegistryLength(
candidate, false);
if (registry && registry != std::string::npos) {
@@ -321,6 +368,8 @@ std::vector<std::string> Extension::GetDistinctHosts(
if (rcd_set.count(no_rcd))
continue;
rcd_set.insert(no_rcd);
+ if (!include_rcd)
+ candidate = no_rcd;
}
if (std::find(distinct_hosts.begin(), distinct_hosts.end(), candidate) ==
distinct_hosts.end()) {
@@ -335,7 +384,9 @@ string16 Extension::GetHostPermissionMessage() const {
if (HasEffectiveAccessToAllHosts())
return l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS);
- std::vector<std::string> hosts = GetDistinctHosts();
+ std::vector<std::string> hosts = GetDistinctHostsForDisplay(
+ GetEffectiveHostPermissions().patterns());
+
if (hosts.size() == 1) {
return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_1_HOST,
UTF8ToUTF16(hosts[0]));
@@ -414,7 +465,7 @@ bool Extension::IdIsValid(const std::string& id) {
std::string Extension::GenerateIdForPath(const FilePath& path) {
FilePath new_path = Extension::MaybeNormalizePath(path);
std::string id;
- if (!GenerateId(WideToUTF8(new_path.ToWStringHack()),&id))
+ if (!GenerateId(WideToUTF8(new_path.ToWStringHack()), &id))
return "";
return id;
}
@@ -1079,52 +1130,48 @@ bool Extension::FormatPEMForFileOutput(const std::string input,
}
// static
-// TODO(aa): A problem with this code is that we silently allow upgrades to
-// extensions that require less permissions than the current version, but then
-// we don't silently allow them to go back. In order to fix this, we would need
-// to remember the max set of permissions we ever granted a single extension.
-bool Extension::IsPrivilegeIncrease(const Extension* old_extension,
+bool Extension::IsPrivilegeIncrease(const bool granted_full_access,
+ const std::set<std::string>& granted_apis,
+ const ExtensionExtent& granted_extent,
const Extension* new_extension) {
- // If the old extension had native code access, we don't need to go any
- // further. Things can't get any worse.
- if (old_extension->plugins().size() > 0)
+ // If the extension had native code access, we don't need to go any further.
+ // Things can't get any worse.
+ if (granted_full_access)
return false;
// Otherwise, if the new extension has a plugin, it's a privilege increase.
- if (new_extension->plugins().size() > 0)
+ if (new_extension->HasFullPermissions())
return true;
- // If we are increasing the set of hosts we have access to (not
- // counting scheme differences), it's a privilege increase.
- if (!old_extension->HasEffectiveAccessToAllHosts()) {
+ // If the extension hadn't been granted access to all hosts in the past, then
+ // see if the extension requires more host permissions.
+ if (!HasEffectiveAccessToAllHosts(granted_extent, granted_apis)) {
if (new_extension->HasEffectiveAccessToAllHosts())
return true;
- // TODO(erikkay) This will trip when you add a new distinct hostname,
- // but we should unique based on RCD as well. crbug.com/57042
- std::vector<std::string> old_hosts = old_extension->GetDistinctHosts();
- std::vector<std::string> new_hosts = new_extension->GetDistinctHosts();
- std::set<std::string> old_hosts_set(old_hosts.begin(), old_hosts.end());
- std::set<std::string> new_hosts_set(new_hosts.begin(), new_hosts.end());
- std::set<std::string> new_only;
- std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
- old_hosts_set.begin(), old_hosts_set.end(),
- std::inserter(new_only, new_only.end()));
- if (new_only.size())
+ const ExtensionExtent new_extent =
+ new_extension->GetEffectiveHostPermissions();
+
+ if (IsElevatedHostList(granted_extent.patterns(), new_extent.patterns()))
return true;
}
- std::set<string16> old_messages =
- old_extension->GetSimplePermissionMessages();
- std::set<string16> new_messages =
- new_extension->GetSimplePermissionMessages();
- std::set<string16> new_only;
- std::set_difference(new_messages.begin(), new_messages.end(),
- old_messages.begin(), old_messages.end(),
- std::inserter(new_only, new_only.end()));
+ std::set<std::string> new_apis = new_extension->api_permissions();
+ std::set<std::string> new_apis_only;
+ std::set_difference(new_apis.begin(), new_apis.end(),
+ granted_apis.begin(), granted_apis.end(),
+ std::inserter(new_apis_only, new_apis_only.begin()));
+
+ // Ignore API permissions that don't require user approval when deciding if
+ // an extension has increased its privileges.
+ size_t new_api_count = 0;
+ for (std::set<std::string>::iterator i = new_apis_only.begin();
+ i != new_apis_only.end(); ++i) {
+ if (GetPermissionMessageId(*i))
+ new_api_count++;
+ }
- // If there are any new permission messages, then it's an increase.
- if (!new_only.empty())
+ if (new_api_count)
return true;
return false;
@@ -1234,7 +1281,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
*error = errors::kInvalidName;
return false;
}
- base::i18n::AdjustStringForLocaleDirection(localized_name, &localized_name);
+ base::i18n::AdjustStringForLocaleDirection(&localized_name);
name_ = UTF16ToUTF8(localized_name);
// Initialize description (if present).
@@ -1706,29 +1753,30 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
}
}
- // Otherwise, it's a host pattern permission.
+ // Check if it's a host pattern permission.
URLPattern pattern = URLPattern(CanExecuteScriptEverywhere() ?
- URLPattern::SCHEME_ALL :
- (UserScript::kValidUserScriptSchemes |
- URLPattern::SCHEME_CHROMEUI) & ~URLPattern::SCHEME_FILE);
+ URLPattern::SCHEME_ALL : kValidHostPermissionSchemes);
- if (URLPattern::PARSE_SUCCESS != pattern.Parse(permission_str)) {
- *error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidPermission, base::IntToString(i));
- return false;
- }
- if (!CanSpecifyHostPermission(pattern)) {
- *error = ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidPermissionScheme, base::IntToString(i));
- return false;
- }
+ if (URLPattern::PARSE_SUCCESS == pattern.Parse(permission_str)) {
+ if (!CanSpecifyHostPermission(pattern)) {
+ *error = ExtensionErrorUtils::FormatErrorMessage(
+ errors::kInvalidPermissionScheme, base::IntToString(i));
+ return false;
+ }
- // The path component is not used for host permissions, so we force it to
- // match all paths.
- pattern.set_path("/*");
+ // The path component is not used for host permissions, so we force it
+ // to match all paths.
+ pattern.set_path("/*");
+
+ host_permissions_.push_back(pattern);
+ }
- host_permissions_.push_back(pattern);
+ // If it's not a host permission, then it's probably an unknown API
+ // permission. Do not throw an error so extensions can retain
+ // backwards compatability (http://crbug.com/42742).
+ // TODO(jstritar): We can improve error messages by adding better
+ // validation of API permissions here.
}
}
@@ -2122,32 +2170,34 @@ bool Extension::CanExecuteScriptOnPage(
return false;
}
-bool Extension::HasEffectiveAccessToAllHosts() const {
+// static
+bool Extension::HasEffectiveAccessToAllHosts(
+ const ExtensionExtent& effective_host_permissions,
+ const std::set<std::string>& api_permissions) {
// Some APIs effectively grant access to every site. New ones should be
// added here. (I'm looking at you, network API)
- if (HasApiPermission(kProxyPermission))
+ if (HasApiPermission(api_permissions, kProxyPermission))
return true;
- for (URLPatternList::const_iterator host = host_permissions().begin();
- host != host_permissions().end(); ++host) {
+ const URLPatternList patterns = effective_host_permissions.patterns();
+ for (URLPatternList::const_iterator host = patterns.begin();
+ host != patterns.end(); ++host) {
if (host->match_subdomains() && host->host().empty())
return true;
}
- for (UserScriptList::const_iterator content_script =
- content_scripts().begin();
- content_script != content_scripts().end(); ++content_script) {
- UserScript::PatternList::const_iterator pattern =
- content_script->url_patterns().begin();
- for (; pattern != content_script->url_patterns().end(); ++pattern) {
- if (pattern->match_subdomains() && pattern->host().empty())
- return true;
- }
- }
-
return false;
}
+bool Extension::HasEffectiveAccessToAllHosts() const {
+ return HasEffectiveAccessToAllHosts(GetEffectiveHostPermissions(),
+ api_permissions());
+}
+
+bool Extension::HasFullPermissions() const {
+ return plugins().size() > 0;
+}
+
bool Extension::IsAPIPermission(const std::string& str) const {
for (size_t i = 0; i < Extension::kNumPermissions; ++i) {
if (str == Extension::kPermissions[i].name) {
@@ -2188,8 +2238,8 @@ bool Extension::CanExecuteScriptEverywhere() const {
}
bool Extension::UpdatesFromGallery() const {
- return update_url() == GURL(extension_urls::kGalleryUpdateHttpsUrl) ||
- update_url() == GURL(extension_urls::kGalleryUpdateHttpUrl);
+ return update_url() == GalleryUpdateUrl(false) ||
+ update_url() == GalleryUpdateUrl(true);
}
ExtensionInfo::ExtensionInfo(const DictionaryValue* manifest,
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 6c545e7..0d171d8 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -49,10 +49,10 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
COMPONENT, // An integral component of Chrome itself, which
// happens to be implemented as an extension. We don't
// show these in the management UI.
- EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via
- // prefs), installed from an update URL.
- EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via
- // admin policies), installed from an update URL.
+ EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via
+ // prefs), installed from an update URL.
+ EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via
+ // admin policies), installed from an update URL.
NUM_LOCATIONS
};
@@ -113,6 +113,9 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
bool require_key,
std::string* error);
+ // Return the update url used by gallery/webstore extensions.
+ static GURL GalleryUpdateUrl(bool secure);
+
// The install message id for |permission|. Returns 0 if none exists.
static int GetPermissionMessageId(const std::string& permission);
@@ -120,13 +123,21 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// should display at install time.
std::vector<string16> GetPermissionMessages() const;
- // Returns the distinct hosts that should be displayed in the install UI. This
- // discards some of the detail that is present in the manifest to make it as
- // easy as possible to process by users. In particular we disregard the scheme
- // and path components of URLPatterns and de-dupe the result.
- static std::vector<std::string> GetDistinctHosts(
- const URLPatternList& host_patterns);
- std::vector<std::string> GetDistinctHosts() const;
+ // Returns the distinct hosts that should be displayed in the install UI
+ // for the URL patterns |list|. This discards some of the detail that is
+ // present in the manifest to make it as easy as possible to process by
+ // users. In particular we disregard the scheme and path components of
+ // URLPatterns and de-dupe the result, which includes filtering out common
+ // hosts with differing RCDs. (NOTE: when de-duping hosts with common RCDs,
+ // the first pattern is returned and the rest discarded)
+ static std::vector<std::string> GetDistinctHostsForDisplay(
+ const URLPatternList& list);
+
+ // Compares two URLPatternLists for security equality by returning whether
+ // the URL patterns in |new_list| contain additional distinct hosts compared
+ // to |old_list|.
+ static bool IsElevatedHostList(
+ const URLPatternList& old_list, const URLPatternList& new_list);
// Icon sizes used by the extension system.
static const int kIconSizes[];
@@ -163,6 +174,12 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// still accepted as meaning the same thing as kUnlimitedStoragePermission.
static const char kOldUnlimitedStoragePermission[];
+ // Valid schemes for web extent URLPatterns.
+ static const int kValidWebExtentSchemes;
+
+ // Valid schemes for host permission URLPatterns.
+ static const int kValidHostPermissionSchemes;
+
// Returns true if the string is one of the known hosted app permissions (see
// kHostedAppPermissionNames).
static bool IsHostedAppPermission(const std::string& permission);
@@ -250,8 +267,11 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
std::string* output, bool is_public);
// Determine whether |new_extension| has increased privileges compared to
- // |old_extension|.
- static bool IsPrivilegeIncrease(const Extension* old_extension,
+ // its previously granted permissions, specified by |granted_apis|,
+ // |granted_extent| and |granted_full_access|.
+ static bool IsPrivilegeIncrease(const bool granted_full_access,
+ const std::set<std::string>& granted_apis,
+ const ExtensionExtent& granted_extent,
const Extension* new_extension);
// Given an extension and icon size, read it if present and decode it into
@@ -301,6 +321,13 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
static bool HasApiPermission(const std::set<std::string>& api_permissions,
const std::string& function_name);
+ // Whether the |effective_host_permissions| and |api_permissions| include
+ // effective access to all hosts. See the non-static version of the method
+ // for more details.
+ static bool HasEffectiveAccessToAllHosts(
+ const ExtensionExtent& effective_host_permissions,
+ const std::set<std::string>& api_permissions);
+
bool HasApiPermission(const std::string& function_name) const {
return HasApiPermission(this->api_permissions(), function_name);
}
@@ -325,6 +352,10 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// network, etc.)
bool HasEffectiveAccessToAllHosts() const;
+ // Whether the extension effectively has all permissions (for example, by
+ // having an NPAPI plugin).
+ bool HasFullPermissions() const;
+
// Returns the Homepage URL for this extension. If homepage_url was not
// specified in the manifest, this returns the Google Gallery URL. For
// third-party extensions, this returns a blank GURL.
@@ -433,6 +464,22 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// sure the drive letter is uppercase.
static FilePath MaybeNormalizePath(const FilePath& path);
+ // Returns the distinct hosts that can be displayed in the install UI or be
+ // used for privilege comparisons. This discards some of the detail that is
+ // present in the manifest to make it as easy as possible to process by users.
+ // In particular we disregard the scheme and path components of URLPatterns
+ // and de-dupe the result, which includes filtering out common hosts with
+ // differing RCDs. If |include_rcd| is true, then the de-duped result
+ // will be the first full entry, including its RCD. So if the list was
+ // "*.google.co.uk" and "*.google.com", the returned value would just be
+ // "*.google.co.uk". Keeping the RCD in the result is useful for display
+ // purposes when you want to show the user one sample hostname from the list.
+ // If you need to compare two URLPatternLists for security equality, then set
+ // |include_rcd| to false, which will return a result like "*.google.",
+ // regardless of the order of the patterns.
+ static std::vector<std::string> GetDistinctHosts(
+ const URLPatternList& host_patterns, bool include_rcd);
+
Extension(const FilePath& path, Location location);
~Extension();
@@ -644,6 +691,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// The Omnibox keyword for this extension, or empty if there is none.
std::string omnibox_keyword_;
+ FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest,
+ UpdateExtensionPreservesLocation);
FRIEND_TEST_ALL_PREFIXES(ExtensionTest, LoadPageActionHelper);
FRIEND_TEST_ALL_PREFIXES(ExtensionTest, InitFromValueInvalid);
FRIEND_TEST_ALL_PREFIXES(ExtensionTest, InitFromValueValid);
diff --git a/chrome/common/extensions/extension_action.cc b/chrome/common/extensions/extension_action.cc
index 6186d79..7139fb2 100644
--- a/chrome/common/extensions/extension_action.cc
+++ b/chrome/common/extensions/extension_action.cc
@@ -8,14 +8,12 @@
#include "app/resource_bundle.h"
#include "base/logging.h"
-#include "base/utf_string_conversions.h"
+#include "chrome/common/badge_util.h"
#include "gfx/canvas_skia.h"
-#include "gfx/font.h"
#include "gfx/rect.h"
#include "googleurl/src/gurl.h"
#include "grit/app_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkTypeface.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
namespace {
@@ -49,44 +47,6 @@ const int kMaxTextWidth = 23;
// The minimum width for center-aligning the badge.
const int kCenterAlignThreshold = 20;
-#if defined(OS_MACOSX)
-const char kPreferredTypeface[] = "Helvetica Bold";
-#else
-const char kPreferredTypeface[] = "Arial";
-#endif
-
-SkPaint* GetTextPaint() {
- static SkPaint* text_paint = NULL;
- if (!text_paint) {
- text_paint = new SkPaint;
- text_paint->setAntiAlias(true);
-
- text_paint->setTextAlign(SkPaint::kLeft_Align);
- text_paint->setTextSize(SkFloatToScalar(kTextSize));
-
- SkTypeface* typeface = SkTypeface::CreateFromName(
- kPreferredTypeface, SkTypeface::kBold);
- // Skia doesn't do any font fallback---if the user is missing the font then
- // typeface will be NULL. If we don't do manual fallback then we'll crash.
- if (typeface) {
- text_paint->setFakeBoldText(true);
- } else {
- // Fall back to the system font. We don't bold it because we aren't sure
- // how it will look.
- // For the most part this code path will only be hit on Linux systems
- // that don't have Arial.
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
- typeface = SkTypeface::CreateFromName(
- WideToUTF8(base_font.GetFontName()).c_str(), SkTypeface::kNormal);
- }
-
- text_paint->setTypeface(typeface);
- // |text_paint| adds its own ref. Release the ref from CreateFontName.
- typeface->unref();
- }
- return text_paint;
-}
} // namespace
@@ -160,7 +120,8 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
canvas->Save();
- SkPaint* text_paint = GetTextPaint();
+ SkPaint* text_paint = badge_util::GetBadgeTextPaintSingleton();
+ text_paint->setTextSize(SkFloatToScalar(kTextSize));
text_paint->setColor(text_color);
// Calculate text width. We clamp it to a max size.
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index b37fcba..8efa529 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -278,12 +278,6 @@ const char* kIllegalPlugins =
namespace extension_urls {
const char* kGalleryBrowsePrefix = "https://chrome.google.com/extensions";
-const char* kGalleryDownloadPrefix =
- "https://clients2.googleusercontent.com/crx/download";
-const char* kGalleryUpdateHttpUrl =
- "http://clients2.google.com/service/update2/crx";
-const char* kGalleryUpdateHttpsUrl =
- "https://clients2.google.com/service/update2/crx";
const char* kMiniGalleryBrowsePrefix = "https://tools.google.com/chrome/";
const char* kMiniGalleryDownloadPrefix = "https://dl-ssl.google.com/chrome/";
}
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index 8c3bee2..065fd0c 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -189,11 +189,6 @@ namespace extension_urls {
// The greatest common prefixes of the main extensions gallery's browse and
// download URLs.
extern const char* kGalleryBrowsePrefix;
- extern const char* kGalleryDownloadPrefix;
-
- // The update urls used by gallery/webstore extensions.
- extern const char* kGalleryUpdateHttpUrl;
- extern const char* kGalleryUpdateHttpsUrl;
// Same thing for the "minigallery". The minigallery is the temporary static
// themes gallery that we put up when we launched themes.
diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc
index 3a89166..446ff31 100644
--- a/chrome/common/extensions/extension_manifests_unittest.cc
+++ b/chrome/common/extensions/extension_manifests_unittest.cc
@@ -294,7 +294,7 @@ TEST_F(ExtensionManifestTest, OptionsPageInApps) {
errors::kInvalidOptionsPageExpectUrlInPackage);
}
-TEST_F(ExtensionManifestTest, DisallowExtensionPermissions) {
+TEST_F(ExtensionManifestTest, AllowUnrecognizedPermissions) {
std::string error;
scoped_ptr<DictionaryValue> manifest(
LoadManifestFile("valid_app.json", &error));
@@ -308,13 +308,11 @@ TEST_F(ExtensionManifestTest, DisallowExtensionPermissions) {
permissions->Clear();
permissions->Append(p);
std::string message_name = base::StringPrintf("permission-%s", name);
- if (Extension::IsHostedAppPermission(name)) {
- scoped_refptr<Extension> extension;
- extension = LoadAndExpectSuccess(manifest.get(), message_name);
- } else {
- LoadAndExpectError(manifest.get(), message_name,
- errors::kInvalidPermission);
- }
+
+ // Extensions are allowed to contain unrecognized API permissions,
+ // so there shouldn't be any errors.
+ scoped_refptr<Extension> extension;
+ extension = LoadAndExpectSuccess(manifest.get(), message_name);
}
}
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 3f86bbd..1130302 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -48,6 +48,11 @@ void CompareLists(const std::vector<std::string>& expected,
}
}
+static void AddPattern(ExtensionExtent* extent, const std::string& pattern) {
+ int schemes = URLPattern::SCHEME_ALL;
+ extent->AddPattern(URLPattern(schemes, pattern));
+}
+
}
class ExtensionTest : public testing::Test {
@@ -252,9 +257,10 @@ TEST(ExtensionTest, InitFromValueInvalid) {
EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error));
EXPECT_TRUE(MatchPattern(error, errors::kInvalidPermission));
+ // We allow unknown API permissions, so this will be valid until we better
+ // distinguish between API and host permissions.
permissions->Set(0, Value::CreateStringValue("www.google.com"));
- EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error));
- EXPECT_TRUE(MatchPattern(error, errors::kInvalidPermission));
+ EXPECT_TRUE(extension.InitFromValue(*input_value, true, &error));
// Multiple page actions are not allowed.
input_value.reset(static_cast<DictionaryValue*>(valid_value->DeepCopy()));
@@ -327,10 +333,11 @@ TEST(ExtensionTest, InitFromValueValid) {
ListValue* permissions = new ListValue;
permissions->Set(0, Value::CreateStringValue("file:///C:/foo.txt"));
input_value.Set(keys::kPermissions, permissions);
- EXPECT_FALSE(extension.InitFromValue(input_value, false, &error));
- EXPECT_TRUE(MatchPattern(error, errors::kInvalidPermission));
+
+ // We allow unknown API permissions, so this will be valid until we better
+ // distinguish between API and host permissions.
+ EXPECT_TRUE(extension.InitFromValue(input_value, false, &error));
input_value.Remove(keys::kPermissions, NULL);
- error.clear();
// Test with an options page.
input_value.SetString(keys::kOptionsPage, "options.html");
@@ -383,7 +390,7 @@ TEST(ExtensionTest, InitFromValueValidNameInRTL) {
EXPECT_TRUE(extension.InitFromValue(input_value, false, &error));
EXPECT_EQ("", error);
std::wstring localized_name(name);
- base::i18n::AdjustStringForLocaleDirection(localized_name, &localized_name);
+ base::i18n::AdjustStringForLocaleDirection(&localized_name);
EXPECT_EQ(localized_name, UTF8ToWide(extension.name()));
// Strong RTL characters in name.
@@ -392,7 +399,7 @@ TEST(ExtensionTest, InitFromValueValidNameInRTL) {
EXPECT_TRUE(extension.InitFromValue(input_value, false, &error));
EXPECT_EQ("", error);
localized_name = name;
- base::i18n::AdjustStringForLocaleDirection(localized_name, &localized_name);
+ base::i18n::AdjustStringForLocaleDirection(&localized_name);
EXPECT_EQ(localized_name, UTF8ToWide(extension.name()));
// Reset locale.
@@ -816,29 +823,60 @@ TEST(ExtensionTest, EffectiveHostPermissions) {
TEST(ExtensionTest, IsPrivilegeIncrease) {
const struct {
const char* base_name;
- bool expect_success;
+ // Increase these sizes if you have more than 10.
+ const char* granted_apis[10];
+ const char* granted_hosts[10];
+ bool full_access;
+ bool expect_increase;
} kTests[] = {
- { "allhosts1", false }, // all -> all
- { "allhosts2", false }, // all -> one
- { "allhosts3", true }, // one -> all
- { "hosts1", false }, // http://a,http://b -> http://a,http://b
- { "hosts2", false }, // http://a,http://b -> https://a,http://*.b
- { "hosts3", false }, // http://a,http://b -> http://a
- { "hosts4", true }, // http://a -> http://a,http://b
- { "hosts5", false }, // http://a,b,c -> http://a,b,c + https://a,b,c
- { "hosts6", false }, // http://a.com -> http://a.com + http://a.co.uk
- { "permissions1", false }, // tabs -> tabs
- { "permissions2", true }, // tabs -> tabs,bookmarks
- { "permissions3", true }, // http://a -> http://a,tabs
- { "permissions5", true }, // bookmarks -> bookmarks,history
+ { "allhosts1", {NULL}, {"http://*/", NULL}, false,
+ false }, // all -> all
+ { "allhosts2", {NULL}, {"http://*/", NULL}, false,
+ false }, // all -> one
+ { "allhosts3", {NULL}, {NULL}, false, true }, // one -> all
+ { "hosts1", {NULL},
+ {"http://www.google.com/", "http://www.reddit.com/", NULL}, false,
+ false }, // http://a,http://b -> http://a,http://b
+ { "hosts2", {NULL},
+ {"http://www.google.com/", "http://www.reddit.com/", NULL}, false,
+ true }, // http://a,http://b -> https://a,http://*.b
+ { "hosts3", {NULL},
+ {"http://www.google.com/", "http://www.reddit.com/", NULL}, false,
+ false }, // http://a,http://b -> http://a
+ { "hosts4", {NULL},
+ {"http://www.google.com/", NULL}, false,
+ true }, // http://a -> http://a,http://b
+ { "hosts5", {"tabs", "notifications", NULL},
+ {"http://*.example.com/", "http://*.example.com/*",
+ "http://*.example.co.uk/*", "http://*.example.com.au/*",
+ NULL}, false,
+ false }, // http://a,b,c -> http://a,b,c + https://a,b,c
+ { "hosts6", {"tabs", "notifications", NULL},
+ {"http://*.example.com/", "http://*.example.com/*", NULL}, false,
+ false }, // http://a.com -> http://a.com + http://a.co.uk
+ { "permissions1", {"tabs", NULL},
+ {NULL}, false, false }, // tabs -> tabs
+ { "permissions2", {"tabs", NULL},
+ {NULL}, false, true }, // tabs -> tabs,bookmarks
+ { "permissions3", {NULL},
+ {"http://*/*", NULL},
+ false, true }, // http://a -> http://a,tabs
+ { "permissions5", {"bookmarks", NULL},
+ {NULL}, false, true }, // bookmarks -> bookmarks,history
#if !defined(OS_CHROMEOS) // plugins aren't allowed in ChromeOS
- { "permissions4", false }, // plugin -> plugin,tabs
- { "plugin1", false }, // plugin -> plugin
- { "plugin2", false }, // plugin -> none
- { "plugin3", true }, // none -> plugin
+ { "permissions4", {NULL},
+ {NULL}, true, false }, // plugin -> plugin,tabs
+ { "plugin1", {NULL},
+ {NULL}, true, false }, // plugin -> plugin
+ { "plugin2", {NULL},
+ {NULL}, true, false }, // plugin -> none
+ { "plugin3", {NULL},
+ {NULL}, false, true }, // none -> plugin
#endif
- { "storage", false }, // none -> storage
- { "notifications", false } // none -> notifications
+ { "storage", {NULL},
+ {NULL}, false, false }, // none -> storage
+ { "notifications", {NULL},
+ {NULL}, false, false } // none -> notifications
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTests); ++i) {
@@ -849,13 +887,22 @@ TEST(ExtensionTest, IsPrivilegeIncrease) {
LoadManifest("allow_silent_upgrade",
std::string(kTests[i].base_name) + "_new.json"));
- EXPECT_TRUE(old_extension.get()) << kTests[i].base_name << "_old.json";
+ std::set<std::string> granted_apis;
+ for (size_t j = 0; kTests[i].granted_apis[j] != NULL; ++j)
+ granted_apis.insert(kTests[i].granted_apis[j]);
+
+ ExtensionExtent granted_hosts;
+ for (size_t j = 0; kTests[i].granted_hosts[j] != NULL; ++j)
+ AddPattern(&granted_hosts, kTests[i].granted_hosts[j]);
+
EXPECT_TRUE(new_extension.get()) << kTests[i].base_name << "_new.json";
- if (!old_extension.get() || !new_extension.get())
+ if (!new_extension.get())
continue;
- EXPECT_EQ(kTests[i].expect_success,
- Extension::IsPrivilegeIncrease(old_extension.get(),
+ EXPECT_EQ(kTests[i].expect_increase,
+ Extension::IsPrivilegeIncrease(kTests[i].full_access,
+ granted_apis,
+ granted_hosts,
new_extension.get()))
<< kTests[i].base_name;
}
@@ -1056,7 +1103,7 @@ TEST(ExtensionTest, ApiPermissions) {
}
}
-TEST(ExtensionTest, GetDistinctHosts) {
+TEST(ExtensionTest, GetDistinctHostsForDisplay) {
std::vector<std::string> expected;
expected.push_back("www.foo.com");
expected.push_back("www.bar.com");
@@ -1074,7 +1121,7 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTP, "http://www.baz.com/path"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHostsForDisplay(actual));
}
{
@@ -1086,7 +1133,7 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTP, "http://www.baz.com/path"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHostsForDisplay(actual));
}
{
@@ -1096,7 +1143,7 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTPS, "https://www.bar.com/path"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHostsForDisplay(actual));
}
{
@@ -1106,7 +1153,7 @@ TEST(ExtensionTest, GetDistinctHosts) {
actual.push_back(
URLPattern(URLPattern::SCHEME_HTTP, "http://www.bar.com/pathypath"));
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHostsForDisplay(actual));
}
{
@@ -1122,7 +1169,7 @@ TEST(ExtensionTest, GetDistinctHosts) {
expected.push_back("bar.com");
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHostsForDisplay(actual));
}
{
@@ -1149,8 +1196,77 @@ TEST(ExtensionTest, GetDistinctHosts) {
expected.push_back("www.foo.xyzzy");
CompareLists(expected,
- Extension::GetDistinctHosts(actual));
+ Extension::GetDistinctHostsForDisplay(actual));
}
+
+ {
+ SCOPED_TRACE("wildcards");
+
+ actual.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://*.google.com/*"));
+
+ expected.push_back("*.google.com");
+
+ CompareLists(expected,
+ Extension::GetDistinctHostsForDisplay(actual));
+ }
+}
+
+TEST(ExtensionTest, IsElevatedHostList) {
+ URLPatternList list1;
+ URLPatternList list2;
+
+ list1.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com.hk/path"));
+ list1.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com/path"));
+
+ // Test that the host order does not matter.
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com/path"));
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com.hk/path"));
+
+ EXPECT_FALSE(Extension::IsElevatedHostList(list1, list2));
+ EXPECT_FALSE(Extension::IsElevatedHostList(list2, list1));
+
+ // Test that paths are ignored.
+ list2.clear();
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com/*"));
+ EXPECT_FALSE(Extension::IsElevatedHostList(list1, list2));
+ EXPECT_FALSE(Extension::IsElevatedHostList(list2, list1));
+
+ // Test that RCDs are ignored.
+ list2.clear();
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com.hk/*"));
+ EXPECT_FALSE(Extension::IsElevatedHostList(list1, list2));
+ EXPECT_FALSE(Extension::IsElevatedHostList(list2, list1));
+
+ // Test that subdomain wildcards are handled properly.
+ list2.clear();
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://*.google.com.hk/*"));
+ EXPECT_TRUE(Extension::IsElevatedHostList(list1, list2));
+ //TODO(jstritar): Does not match subdomains properly. http://crbug.com/65337
+ //EXPECT_FALSE(Extension::IsElevatedHostList(list2, list1));
+
+ // Test that different domains count as different hosts.
+ list2.clear();
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.google.com/path"));
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://www.example.org/path"));
+ EXPECT_TRUE(Extension::IsElevatedHostList(list1, list2));
+ EXPECT_FALSE(Extension::IsElevatedHostList(list2, list1));
+
+ // Test that different subdomains count as different hosts.
+ list2.clear();
+ list2.push_back(
+ URLPattern(URLPattern::SCHEME_HTTP, "http://mail.google.com/*"));
+ EXPECT_TRUE(Extension::IsElevatedHostList(list1, list2));
+ EXPECT_TRUE(Extension::IsElevatedHostList(list2, list1));
}
TEST(ExtensionTest, GenerateId) {
diff --git a/chrome/common/file_system/webfilesystem_callback_dispatcher.cc b/chrome/common/file_system/webfilesystem_callback_dispatcher.cc
index 6d779a2..24a162a 100644
--- a/chrome/common/file_system/webfilesystem_callback_dispatcher.cc
+++ b/chrome/common/file_system/webfilesystem_callback_dispatcher.cc
@@ -4,7 +4,11 @@
#include "chrome/common/file_system/webfilesystem_callback_dispatcher.h"
+#include <string>
+#include <vector>
+
#include "base/file_util_proxy.h"
+#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h"
@@ -66,4 +70,3 @@ void WebFileSystemCallbackDispatcher::DidFail(
void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) {
NOTREACHED();
}
-
diff --git a/chrome/common/gpu_messages.cc b/chrome/common/gpu_messages.cc
index 1ba2efa..bd850a1 100644
--- a/chrome/common/gpu_messages.cc
+++ b/chrome/common/gpu_messages.cc
@@ -31,6 +31,15 @@ GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params::
identifier(0) {
}
+GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params::
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params()
+ : renderer_id(0),
+ render_view_id(0),
+ window(NULL),
+ surface_id(0),
+ route_id(0),
+ swap_buffers_count(0) {
+}
#endif
namespace IPC {
@@ -78,6 +87,46 @@ void ParamTraits<GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params> ::Log(
l->append(")");
}
+void ParamTraits<GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params> ::Write(
+ Message* m,
+ const param_type& p) {
+ WriteParam(m, p.renderer_id);
+ WriteParam(m, p.render_view_id);
+ WriteParam(m, p.window);
+ WriteParam(m, p.surface_id);
+ WriteParam(m, p.route_id);
+ WriteParam(m, p.swap_buffers_count);
+}
+
+bool ParamTraits<GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params> ::Read(
+ const Message* m,
+ void** iter,
+ param_type* p) {
+ return ReadParam(m, iter, &p->renderer_id) &&
+ ReadParam(m, iter, &p->render_view_id) &&
+ ReadParam(m, iter, &p->window) &&
+ ReadParam(m, iter, &p->surface_id) &&
+ ReadParam(m, iter, &p->route_id) &&
+ ReadParam(m, iter, &p->swap_buffers_count);
+}
+
+void ParamTraits<GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params> ::Log(
+ const param_type& p,
+ std::string* l) {
+ l->append("(");
+ LogParam(p.renderer_id, l);
+ l->append(", ");
+ LogParam(p.render_view_id, l);
+ l->append(", ");
+ LogParam(p.window, l);
+ l->append(", ");
+ LogParam(p.surface_id, l);
+ l->append(", ");
+ LogParam(p.route_id, l);
+ l->append(", ");
+ LogParam(p.swap_buffers_count, l);
+ l->append(")");
+}
#endif // if defined(OS_MACOSX)
void ParamTraits<GPUInfo> ::Write(Message* m, const param_type& p) {
diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h
index 1b51c03..e4badaa 100644
--- a/chrome/common/gpu_messages_internal.h
+++ b/chrome/common/gpu_messages_internal.h
@@ -51,6 +51,18 @@ IPC_BEGIN_MESSAGES(Gpu)
// information.
IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
+#if defined(OS_MACOSX)
+ // Tells the GPU process that the browser process handled the swap
+ // buffers request with the given number. Note that it is possible
+ // for the browser process to coalesce frames; it is not guaranteed
+ // that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message
+ // will result in a buffer swap on the browser side.
+ IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceBuffersSwappedACK,
+ int /* renderer_id */,
+ int32 /* route_id */,
+ uint64 /* swap_buffers_count */)
+#endif
+
// Tells the GPU process to crash.
IPC_MESSAGE_CONTROL0(GpuMsg_Crash)
@@ -81,6 +93,17 @@ IPC_BEGIN_MESSAGES(GpuHost)
IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID,
gfx::NativeViewId, /* view */
unsigned long /* xid */)
+
+ // Release the lock on the window.
+ // If the associated view has been destroyed, destroy the window.
+ IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID,
+ unsigned long /* xid */)
+
+ IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID,
+ unsigned long, /* xid */
+ gfx::Size, /* size */
+ bool /* success */)
+
#elif defined(OS_MACOSX)
// This message, used on Mac OS X 10.6 and later (where IOSurface is
// supported), is sent from the GPU process to the browser to indicate that a
@@ -93,11 +116,18 @@ IPC_BEGIN_MESSAGES(GpuHost)
// This message notifies the browser process that the renderer
// swapped the buffers associated with the given "window", which
// should cause the browser to redraw the compositor's contents.
- IPC_MESSAGE_CONTROL4(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
+ IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)
+#elif defined(OS_WIN)
+ // Get the HWND for the compositor window and if necessary, create it
+ IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_GetCompositorHostWindow,
+ int32, /* renderer_id */
+ int32, /* render_view_id */
+ gfx::PluginWindowHandle /* compositor_host_id */)
+
+ IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite,
int32, /* renderer_id */
- int32, /* render_view_id */
- gfx::PluginWindowHandle /* window */,
- uint64 /* surface_id */)
+ int32 /* render_view_id */)
#endif
IPC_END_MESSAGES(GpuHost)
@@ -225,13 +255,6 @@ IPC_BEGIN_MESSAGES(GpuCommandBuffer)
// browser. This message is currently used only on 10.6 and later.
IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetWindowSize,
gfx::Size /* size */)
-
- // This message is sent from the GPU process to the renderer process (and
- // from there the browser process) that the buffers associated with the
- // given "window" were swapped, which should cause the browser to redraw
- // the various accelerated surfaces.
- IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_AcceleratedSurfaceBuffersSwapped,
- gfx::PluginWindowHandle /* window */)
#endif
IPC_END_MESSAGES(GpuCommandBuffer)
diff --git a/chrome/common/gpu_param_traits.h b/chrome/common/gpu_param_traits.h
index 2aac31a..3ebaca0 100644
--- a/chrome/common/gpu_param_traits.h
+++ b/chrome/common/gpu_param_traits.h
@@ -31,6 +31,17 @@ struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params {
GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params();
};
+
+struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params {
+ int32 renderer_id;
+ int32 render_view_id;
+ gfx::PluginWindowHandle window;
+ uint64 surface_id;
+ int32 route_id;
+ uint64 swap_buffers_count;
+
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params();
+};
#endif
namespace IPC {
@@ -42,6 +53,14 @@ struct ParamTraits<GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params> {
static bool Read(const Message* m, void** iter, param_type* p);
static void Log(const param_type& p, std::string* l);
};
+
+template <>
+struct ParamTraits<GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params> {
+ typedef GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* p);
+ static void Log(const param_type& p, std::string* l);
+};
#endif
template <>
diff --git a/chrome/common/indexed_db_key.cc b/chrome/common/indexed_db_key.cc
index 9f7d153..4488673 100644
--- a/chrome/common/indexed_db_key.cc
+++ b/chrome/common/indexed_db_key.cc
@@ -34,7 +34,7 @@ void IndexedDBKey::Set(const string16& string) {
string_ = string;
}
-void IndexedDBKey::Set(int32_t number) {
+void IndexedDBKey::Set(double number) {
type_ = WebIDBKey::NumberType;
number_ = number;
}
diff --git a/chrome/common/indexed_db_key.h b/chrome/common/indexed_db_key.h
index 29c1792..60b4529 100644
--- a/chrome/common/indexed_db_key.h
+++ b/chrome/common/indexed_db_key.h
@@ -19,19 +19,19 @@ class IndexedDBKey {
void SetNull();
void SetInvalid();
void Set(const string16& string);
- void Set(int32_t number);
+ void Set(double number);
void Set(const WebKit::WebIDBKey& key);
WebKit::WebIDBKey::Type type() const { return type_; }
const string16& string() const { return string_; }
- int32_t number() const { return number_; }
+ double number() const { return number_; }
operator WebKit::WebIDBKey() const;
private:
WebKit::WebIDBKey::Type type_;
string16 string_;
- int32_t number_;
+ double number_;
};
#endif // CHROME_COMMON_INDEXED_DB_KEY_H_
diff --git a/chrome/common/indexed_db_param_traits.cc b/chrome/common/indexed_db_param_traits.cc
index fd47ecf..3bab96e 100644
--- a/chrome/common/indexed_db_param_traits.cc
+++ b/chrome/common/indexed_db_param_traits.cc
@@ -58,7 +58,7 @@ bool ParamTraits<IndexedDBKey>::Read(const Message* m,
param_type* r) {
int type;
string16 string;
- int32 number;
+ double number;
bool ok =
ReadParam(m, iter, &type) &&
ReadParam(m, iter, &string) &&
diff --git a/chrome/common/metrics_helpers.cc b/chrome/common/metrics_helpers.cc
index d5d8f78..6462383 100644
--- a/chrome/common/metrics_helpers.cc
+++ b/chrome/common/metrics_helpers.cc
@@ -563,7 +563,6 @@ void HistogramSender::TransmitHistogram(const Histogram& histogram) {
}
// Snapshot now contains only a delta to what we've already_logged.
- DCHECK_EQ(snapshot.TotalCount(), snapshot.redundant_count());
if (snapshot.redundant_count() > 0) {
TransmitHistogramDelta(histogram, snapshot);
// Add new data into our running total.
diff --git a/chrome/common/multi_process_lock_linux.cc b/chrome/common/multi_process_lock_linux.cc
index c0c92c7..ccc2186 100644
--- a/chrome/common/multi_process_lock_linux.cc
+++ b/chrome/common/multi_process_lock_linux.cc
@@ -30,7 +30,8 @@ class MultiProcessLockLinux : public MultiProcessLock {
}
if (name_.length() > MULTI_PROCESS_LOCK_NAME_MAX_LEN) {
- LOG(ERROR) << "Socket name too long - " << name_;
+ LOG(ERROR) << "Socket name too long (" << name_.length()
+ << " > " << MULTI_PROCESS_LOCK_NAME_MAX_LEN << ") - " << name_;
return false;
}
diff --git a/chrome/common/multi_process_lock_mac.cc b/chrome/common/multi_process_lock_mac.cc
index 9a16d71..dfeb2f6 100644
--- a/chrome/common/multi_process_lock_mac.cc
+++ b/chrome/common/multi_process_lock_mac.cc
@@ -25,7 +25,8 @@ class MultiProcessLockMac : public MultiProcessLock {
}
if (name_.length() > MULTI_PROCESS_LOCK_NAME_MAX_LEN) {
- LOG(ERROR) << "Socket name too long - " << name_;
+ LOG(ERROR) << "Socket name too long (" << name_.length()
+ << " > " << MULTI_PROCESS_LOCK_NAME_MAX_LEN << ") - " << name_;
return false;
}
diff --git a/chrome/common/multi_process_lock_win.cc b/chrome/common/multi_process_lock_win.cc
index 8bb525d..ea31da6 100644
--- a/chrome/common/multi_process_lock_win.cc
+++ b/chrome/common/multi_process_lock_win.cc
@@ -25,7 +25,8 @@ class MultiProcessLockWin : public MultiProcessLock {
}
if (name_.length() > MULTI_PROCESS_LOCK_NAME_MAX_LEN) {
- LOG(ERROR) << "Socket name too long - " << name_;
+ LOG(ERROR) << "Socket name too long (" << name_.length()
+ << " > " << MULTI_PROCESS_LOCK_NAME_MAX_LEN << ") - " << name_;
return false;
}
diff --git a/chrome/common/net/gaia/gaia_auth_consumer.h b/chrome/common/net/gaia/gaia_auth_consumer.h
index 706d19e..d498e6c 100644
--- a/chrome/common/net/gaia/gaia_auth_consumer.h
+++ b/chrome/common/net/gaia/gaia_auth_consumer.h
@@ -15,7 +15,7 @@ class GoogleServiceAuthError;
class GaiaAuthConsumer {
public:
struct ClientLoginResult {
- inline ClientLoginResult() {}
+ inline ClientLoginResult() : two_factor(false) {}
inline ClientLoginResult(const std::string& new_sid,
const std::string& new_lsid,
const std::string& new_token,
@@ -23,13 +23,15 @@ class GaiaAuthConsumer {
: sid(new_sid),
lsid(new_lsid),
token(new_token),
- data(new_data) {}
+ data(new_data),
+ two_factor(false) {}
inline bool operator==(const ClientLoginResult &b) const {
return sid == b.sid &&
lsid == b.lsid &&
token == b.token &&
- data == b.data;
+ data == b.data &&
+ two_factor == b.two_factor;
}
std::string sid;
@@ -37,6 +39,7 @@ class GaiaAuthConsumer {
std::string token;
// TODO(chron): Remove the data field later. Don't use it if possible.
std::string data; // Full contents of ClientLogin return.
+ bool two_factor; // set to true if there was a TWO_FACTOR "failure".
};
virtual ~GaiaAuthConsumer() {}
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.cc b/chrome/common/net/gaia/gaia_auth_fetcher.cc
index ec6e808..0499168 100644
--- a/chrome/common/net/gaia/gaia_auth_fetcher.cc
+++ b/chrome/common/net/gaia/gaia_auth_fetcher.cc
@@ -53,6 +53,8 @@ const char GaiaAuthFetcher::kAccountDeletedError[] = "AccountDeleted";
// static
const char GaiaAuthFetcher::kAccountDisabledError[] = "AccountDisabled";
// static
+const char GaiaAuthFetcher::kBadAuthenticationError[] = "BadAuthentication";
+// static
const char GaiaAuthFetcher::kCaptchaError[] = "CaptchaRequired";
// static
const char GaiaAuthFetcher::kServiceUnavailableError[] =
@@ -344,13 +346,18 @@ GoogleServiceAuthError GaiaAuthFetcher::GenerateAuthError(
return GoogleServiceAuthError(GoogleServiceAuthError::ACCOUNT_DELETED);
if (error == kAccountDisabledError)
return GoogleServiceAuthError(GoogleServiceAuthError::ACCOUNT_DISABLED);
+ if (error == kBadAuthenticationError) {
+ return GoogleServiceAuthError(
+ GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
+ }
if (error == kServiceUnavailableError) {
return GoogleServiceAuthError(
GoogleServiceAuthError::SERVICE_UNAVAILABLE);
}
+ LOG(WARNING) << "Incomprehensible response from Google Accounts servers.";
return GoogleServiceAuthError(
- GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
+ GoogleServiceAuthError::SERVICE_UNAVAILABLE);
}
NOTREACHED();
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.h b/chrome/common/net/gaia/gaia_auth_fetcher.h
index fd644a3..e0fe76e 100644
--- a/chrome/common/net/gaia/gaia_auth_fetcher.h
+++ b/chrome/common/net/gaia/gaia_auth_fetcher.h
@@ -105,6 +105,7 @@ class GaiaAuthFetcher : public URLFetcher::Delegate {
// Constants for parsing ClientLogin errors.
static const char kAccountDeletedError[];
static const char kAccountDisabledError[];
+ static const char kBadAuthenticationError[];
static const char kCaptchaError[];
static const char kServiceUnavailableError[];
static const char kErrorParam[];
@@ -192,6 +193,8 @@ class GaiaAuthFetcher : public URLFetcher::Delegate {
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CaptchaParse);
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDeletedError);
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDisabledError);
+ FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, BadAuthenticationError);
+ FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, IncomprehensibleError);
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ServiceUnavailableError);
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckNormalErrorCode);
FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckTwoFactorResponse);
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
index 47df6b7..c7814c9 100644
--- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
@@ -73,6 +73,8 @@ class GaiaAuthFetcherTest : public testing::Test {
GURL client_login_source_;
GURL issue_auth_token_source_;
TestingProfile profile_;
+ protected:
+ MessageLoop message_loop_;
};
class MockGaiaConsumer : public GaiaAuthConsumer {
@@ -157,7 +159,7 @@ TEST_F(GaiaAuthFetcherTest, TokenNetFailure) {
TEST_F(GaiaAuthFetcherTest, LoginDenied) {
- std::string data("Error: NO!");
+ std::string data("Error=BadAuthentication");
URLRequestStatus status(URLRequestStatus::SUCCESS, 0);
GoogleServiceAuthError expected_error(
@@ -312,6 +314,22 @@ TEST_F(GaiaAuthFetcherTest, AccountDisabledError) {
EXPECT_EQ(error.state(), GoogleServiceAuthError::ACCOUNT_DISABLED);
}
+TEST_F(GaiaAuthFetcherTest,BadAuthenticationError) {
+ URLRequestStatus status(URLRequestStatus::SUCCESS, 0);
+ std::string data = "Error=BadAuthentication\n";
+ GoogleServiceAuthError error =
+ GaiaAuthFetcher::GenerateAuthError(data, status);
+ EXPECT_EQ(error.state(), GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
+}
+
+TEST_F(GaiaAuthFetcherTest,IncomprehensibleError) {
+ URLRequestStatus status(URLRequestStatus::SUCCESS, 0);
+ std::string data = "Error=Gobbledygook\n";
+ GoogleServiceAuthError error =
+ GaiaAuthFetcher::GenerateAuthError(data, status);
+ EXPECT_EQ(error.state(), GoogleServiceAuthError::SERVICE_UNAVAILABLE);
+}
+
TEST_F(GaiaAuthFetcherTest,ServiceUnavailableError) {
URLRequestStatus status(URLRequestStatus::SUCCESS, 0);
std::string data = "Error=ServiceUnavailable\n";
diff --git a/chrome/common/net/test_url_fetcher_factory.cc b/chrome/common/net/test_url_fetcher_factory.cc
index 48fb314..8336dfd 100644
--- a/chrome/common/net/test_url_fetcher_factory.cc
+++ b/chrome/common/net/test_url_fetcher_factory.cc
@@ -5,6 +5,7 @@
#include "chrome/common/net/test_url_fetcher_factory.h"
#include <string>
+#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "net/url_request/url_request_status.h"
diff --git a/chrome/common/net/url_fetcher.cc b/chrome/common/net/url_fetcher.cc
index e7fcbd2..64a12f8 100644
--- a/chrome/common/net/url_fetcher.cc
+++ b/chrome/common/net/url_fetcher.cc
@@ -14,15 +14,16 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/thread.h"
-#include "chrome/common/net/url_fetcher_protect.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_throttler_manager.h"
#ifdef ANDROID
#include "android/autofill/url_fetcher_proxy.h"
@@ -57,6 +58,9 @@ class URLFetcher::Core
// safe to call this multiple times.
void Stop();
+ // Reports that the received content was malformed.
+ void ReceivedContentWasMalformed();
+
// URLRequest::Delegate implementation.
virtual void OnResponseStarted(URLRequest* request);
virtual void OnReadCompleted(URLRequest* request, int bytes_read);
@@ -89,19 +93,27 @@ class URLFetcher::Core
// Wrapper functions that allow us to ensure actions happen on the right
// thread.
void StartURLRequest();
+ void StartURLRequestWhenAppropriate();
void CancelURLRequest();
void OnCompletedURLRequest(const URLRequestStatus& status);
+ void NotifyMalformedContent();
// Deletes the request, removes it from the registry, and removes the
// destruction observer.
void ReleaseRequest();
+ // Returns the max value of exponential back-off release time for
+ // |original_url_| and |url_|.
+ base::TimeTicks GetBackoffReleaseTime();
+
URLFetcher* fetcher_; // Corresponding fetcher object
GURL original_url_; // The URL we were asked to fetch
GURL url_; // The URL we eventually wound up at
RequestType request_type_; // What type of request is this?
URLFetcher::Delegate* delegate_; // Object to notify on completion
- MessageLoop* delegate_loop_; // Message loop of the creating thread
+ scoped_refptr<base::MessageLoopProxy> delegate_loop_proxy_;
+ // Message loop proxy of the creating
+ // thread.
scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
// The message loop proxy for the thread
// on which the request IO happens.
@@ -120,20 +132,31 @@ class URLFetcher::Core
std::string upload_content_; // HTTP POST payload
std::string upload_content_type_; // MIME type of POST payload
- // The overload protection entry for this URL. This is used to
- // incrementally back off how rapidly we'll send requests to a particular
- // URL, to avoid placing too much demand on the remote resource. We update
- // this with the status of all requests as they return, and in turn use it
- // to determine how long to wait before making another request.
- URLFetcherProtectEntry* protect_entry_;
+ // Used to determine how long to wait before making a request or doing a
+ // retry.
+ // Both of them can only be accessed on the IO thread.
+ // We need not only the throttler entry for |original_URL|, but also the one
+ // for |url|. For example, consider the case that URL A redirects to URL B,
+ // for which the server returns a 500 response. In this case, the exponential
+ // back-off release time of URL A won't increase. If we retry without
+ // considering the back-off constraint of URL B, we may send out too many
+ // requests for URL A in a short period of time.
+ scoped_refptr<net::URLRequestThrottlerEntryInterface>
+ original_url_throttler_entry_;
+ scoped_refptr<net::URLRequestThrottlerEntryInterface> url_throttler_entry_;
+
// |num_retries_| indicates how many times we've failed to successfully
// fetch this URL. Once this value exceeds the maximum number of retries
- // specified by the protection manager, we'll give up.
+ // specified by the owner URLFetcher instance, we'll give up.
int num_retries_;
// True if the URLFetcher has been cancelled.
bool was_cancelled_;
+ // Since GetBackoffReleaseTime() can only be called on the IO thread, we cache
+ // its value to be used by OnCompletedURLRequest on the creating thread.
+ base::TimeTicks backoff_release_time_;
+
static base::LazyInstance<Registry> g_registry;
friend class URLFetcher;
@@ -174,7 +197,8 @@ URLFetcher::URLFetcher(const GURL& url,
Delegate* d)
: ALLOW_THIS_IN_INITIALIZER_LIST(
core_(new Core(this, url, request_type, d))),
- automatically_retry_on_5xx_(true) {
+ automatically_retry_on_5xx_(true),
+ max_retries_(0) {
}
URLFetcher::~URLFetcher() {
@@ -201,13 +225,11 @@ URLFetcher::Core::Core(URLFetcher* fetcher,
original_url_(original_url),
request_type_(request_type),
delegate_(d),
- delegate_loop_(MessageLoop::current()),
+ delegate_loop_proxy_(base::MessageLoopProxy::CreateForCurrentThread()),
request_(NULL),
load_flags_(net::LOAD_NORMAL),
response_code_(-1),
buffer_(new net::IOBuffer(kBufferSize)),
- protect_entry_(URLFetcherProtectManager::GetInstance()->Register(
- original_url_.host())),
num_retries_(0),
was_cancelled_(false) {
}
@@ -219,18 +241,18 @@ URLFetcher::Core::~Core() {
}
void URLFetcher::Core::Start() {
- DCHECK(delegate_loop_);
+ DCHECK(delegate_loop_proxy_);
CHECK(request_context_getter_) << "We need an URLRequestContext!";
io_message_loop_proxy_ = request_context_getter_->GetIOMessageLoopProxy();
CHECK(io_message_loop_proxy_.get()) << "We need an IO message loop proxy";
- io_message_loop_proxy_->PostDelayedTask(
+
+ io_message_loop_proxy_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &Core::StartURLRequest),
- protect_entry_->UpdateBackoff(URLFetcherProtectEntry::SEND));
+ NewRunnableMethod(this, &Core::StartURLRequestWhenAppropriate));
}
void URLFetcher::Core::Stop() {
- DCHECK_EQ(MessageLoop::current(), delegate_loop_);
+ DCHECK(delegate_loop_proxy_->BelongsToCurrentThread());
delegate_ = NULL;
fetcher_ = NULL;
if (io_message_loop_proxy_.get()) {
@@ -239,6 +261,14 @@ void URLFetcher::Core::Stop() {
}
}
+void URLFetcher::Core::ReceivedContentWasMalformed() {
+ DCHECK(delegate_loop_proxy_->BelongsToCurrentThread());
+ if (io_message_loop_proxy_.get()) {
+ io_message_loop_proxy_->PostTask(
+ FROM_HERE, NewRunnableMethod(this, &Core::NotifyMalformedContent));
+ }
+}
+
void URLFetcher::Core::CancelAll() {
g_registry.Get().CancelAll();
}
@@ -266,6 +296,8 @@ void URLFetcher::Core::OnReadCompleted(URLRequest* request, int bytes_read) {
DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
url_ = request->url();
+ url_throttler_entry_ =
+ net::URLRequestThrottlerManager::GetInstance()->RegisterRequestUrl(url_);
do {
if (!request_->status().is_success() || bytes_read <= 0)
@@ -278,8 +310,16 @@ void URLFetcher::Core::OnReadCompleted(URLRequest* request, int bytes_read) {
// See comments re: HEAD requests in OnResponseStarted().
if (!request_->status().is_io_pending() || (request_type_ == HEAD)) {
- delegate_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &Core::OnCompletedURLRequest, request_->status()));
+ backoff_release_time_ = GetBackoffReleaseTime();
+
+ bool posted = delegate_loop_proxy_->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(this,
+ &Core::OnCompletedURLRequest,
+ request_->status()));
+ // If the delegate message loop does not exist any more, then the delegate
+ // should be gone too.
+ DCHECK(posted || !delegate_);
ReleaseRequest();
}
}
@@ -331,9 +371,36 @@ void URLFetcher::Core::StartURLRequest() {
if (!extra_request_headers_.IsEmpty())
request_->SetExtraRequestHeaders(extra_request_headers_);
+ // There might be data left over from a previous request attempt.
+ data_.clear();
+
request_->Start();
}
+void URLFetcher::Core::StartURLRequestWhenAppropriate() {
+ DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
+
+ if (was_cancelled_)
+ return;
+
+ if (original_url_throttler_entry_ == NULL) {
+ original_url_throttler_entry_ =
+ net::URLRequestThrottlerManager::GetInstance()->RegisterRequestUrl(
+ original_url_);
+ }
+
+ int64 delay = original_url_throttler_entry_->ReserveSendingTimeForNextRequest(
+ GetBackoffReleaseTime());
+ if (delay == 0) {
+ StartURLRequest();
+ } else {
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ NewRunnableMethod(this, &Core::StartURLRequest),
+ delay);
+ }
+}
+
void URLFetcher::Core::CancelURLRequest() {
DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
@@ -350,33 +417,31 @@ void URLFetcher::Core::CancelURLRequest() {
}
void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) {
- DCHECK(MessageLoop::current() == delegate_loop_);
+ DCHECK(delegate_loop_proxy_->BelongsToCurrentThread());
// Checks the response from server.
- if (response_code_ >= 500) {
+ if (response_code_ >= 500 ||
+ status.os_error() == net::ERR_TEMPORARILY_THROTTLED) {
// When encountering a server error, we will send the request again
// after backoff time.
- int64 back_off_time =
- protect_entry_->UpdateBackoff(URLFetcherProtectEntry::FAILURE);
- if (delegate_) {
- fetcher_->backoff_delay_ =
- base::TimeDelta::FromMilliseconds(back_off_time);
- }
++num_retries_;
// Restarts the request if we still need to notify the delegate.
if (delegate_) {
+ fetcher_->backoff_delay_ = backoff_release_time_ - base::TimeTicks::Now();
+ if (fetcher_->backoff_delay_ < base::TimeDelta())
+ fetcher_->backoff_delay_ = base::TimeDelta();
+
if (fetcher_->automatically_retry_on_5xx_ &&
- num_retries_ <= protect_entry_->max_retries()) {
- io_message_loop_proxy_->PostDelayedTask(
+ num_retries_ <= fetcher_->max_retries()) {
+ io_message_loop_proxy_->PostTask(
FROM_HERE,
- NewRunnableMethod(this, &Core::StartURLRequest), back_off_time);
+ NewRunnableMethod(this, &Core::StartURLRequestWhenAppropriate));
} else {
delegate_->OnURLFetchComplete(fetcher_, url_, status, response_code_,
cookies_, data_);
}
}
} else {
- protect_entry_->UpdateBackoff(URLFetcherProtectEntry::SUCCESS);
if (delegate_) {
fetcher_->backoff_delay_ = base::TimeDelta();
delegate_->OnURLFetchComplete(fetcher_, url_, status, response_code_,
@@ -385,13 +450,36 @@ void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) {
}
}
+void URLFetcher::Core::NotifyMalformedContent() {
+ DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
+ if (url_throttler_entry_ != NULL)
+ url_throttler_entry_->ReceivedContentWasMalformed();
+}
+
void URLFetcher::Core::ReleaseRequest() {
request_.reset();
g_registry.Get().RemoveURLFetcherCore(this);
}
+base::TimeTicks URLFetcher::Core::GetBackoffReleaseTime() {
+ DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
+ DCHECK(original_url_throttler_entry_ != NULL);
+
+ base::TimeTicks original_url_backoff =
+ original_url_throttler_entry_->GetExponentialBackoffReleaseTime();
+ base::TimeTicks destination_url_backoff;
+ if (url_throttler_entry_ != NULL &&
+ original_url_throttler_entry_ != url_throttler_entry_) {
+ destination_url_backoff =
+ url_throttler_entry_->GetExponentialBackoffReleaseTime();
+ }
+
+ return original_url_backoff > destination_url_backoff ?
+ original_url_backoff : destination_url_backoff;
+}
+
void URLFetcher::set_upload_data(const std::string& upload_content_type,
- const std::string& upload_content) {
+ const std::string& upload_content) {
core_->upload_content_type_ = upload_content_type;
core_->upload_content_ = upload_content;
}
@@ -441,6 +529,10 @@ const GURL& URLFetcher::url() const {
return core_->url_;
}
+void URLFetcher::ReceivedContentWasMalformed() {
+ core_->ReceivedContentWasMalformed();
+}
+
// static
void URLFetcher::CancelAll() {
Core::CancelAll();
diff --git a/chrome/common/net/url_fetcher.h b/chrome/common/net/url_fetcher.h
index 8566d42..78ad752 100644
--- a/chrome/common/net/url_fetcher.h
+++ b/chrome/common/net/url_fetcher.h
@@ -16,6 +16,7 @@
#pragma once
#include <string>
+#include <vector>
#include "base/message_loop.h"
#include "base/ref_counted.h"
@@ -168,6 +169,10 @@ class URLFetcher {
#endif
void set_automatically_retry_on_5xx(bool retry);
+ int max_retries() const { return max_retries_; }
+
+ void set_max_retries(int max_retries) { max_retries_ = max_retries; }
+
// Returns the back-off delay before the request will be retried,
// when a 5xx response was received.
base::TimeDelta backoff_delay() const { return backoff_delay_; }
@@ -190,6 +195,9 @@ class URLFetcher {
// Return the URL that this fetcher is processing.
const GURL& url() const;
+ // Reports that the received content was malformed.
+ void ReceivedContentWasMalformed();
+
// Cancels all existing URLRequests. Will notify the URLFetcher::Delegates.
// Note that any new URLFetchers created while this is running will not be
// cancelled. Typically, one would call this in the CleanUp() method of an IO
@@ -219,6 +227,8 @@ class URLFetcher {
bool automatically_retry_on_5xx_;
// Back-off time delay. 0 by default.
base::TimeDelta backoff_delay_;
+ // Maximum retries allowed.
+ int max_retries_;
static bool g_interception_enabled;
diff --git a/chrome/common/net/url_fetcher_protect.cc b/chrome/common/net/url_fetcher_protect.cc
index f078fd4..e69de29 100644
--- a/chrome/common/net/url_fetcher_protect.cc
+++ b/chrome/common/net/url_fetcher_protect.cc
@@ -1,180 +0,0 @@
-// Copyright (c) 2006-2008 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/common/net/url_fetcher_protect.h"
-
-#include "base/logging.h"
-
-// URLFetcherProtectEntry ----------------------------------------------------
-
-using base::TimeDelta;
-using base::TimeTicks;
-
-// Default parameters. Time is in milliseconds.
-// static
-const int URLFetcherProtectEntry::kDefaultSlidingWindowPeriod = 2000;
-
-const int URLFetcherProtectEntry::kDefaultMaxSendThreshold = 20;
-const int URLFetcherProtectEntry::kDefaultMaxRetries = 0;
-
-const int URLFetcherProtectEntry::kDefaultInitialTimeout = 100;
-const double URLFetcherProtectEntry::kDefaultMultiplier = 2.0;
-const int URLFetcherProtectEntry::kDefaultConstantFactor = 100;
-const int URLFetcherProtectEntry::kDefaultMaximumTimeout = 60000;
-
-
-URLFetcherProtectEntry::URLFetcherProtectEntry()
- : sliding_window_period_(kDefaultSlidingWindowPeriod),
- max_send_threshold_(kDefaultMaxSendThreshold),
- max_retries_(kDefaultMaxRetries),
- initial_timeout_(kDefaultInitialTimeout),
- multiplier_(kDefaultMultiplier),
- constant_factor_(kDefaultConstantFactor),
- maximum_timeout_(kDefaultMaximumTimeout) {
- ResetBackoff();
-}
-
-URLFetcherProtectEntry::URLFetcherProtectEntry(int sliding_window_period,
- int max_send_threshold,
- int max_retries,
- int initial_timeout,
- double multiplier,
- int constant_factor,
- int maximum_timeout)
- : sliding_window_period_(sliding_window_period),
- max_send_threshold_(max_send_threshold),
- max_retries_(max_retries),
- initial_timeout_(initial_timeout),
- multiplier_(multiplier),
- constant_factor_(constant_factor),
- maximum_timeout_(maximum_timeout) {
- ResetBackoff();
-}
-
-URLFetcherProtectEntry::~URLFetcherProtectEntry() {}
-
-int64 URLFetcherProtectEntry::UpdateBackoff(EventType event_type) {
- // request may be sent in different threads
- AutoLock lock(lock_);
-
- TimeDelta t;
- switch (event_type) {
- case SEND:
- t = AntiOverload();
- break;
- case SUCCESS:
- t = ResetBackoff();
- break;
- case FAILURE:
- t = IncreaseBackoff();
- break;
- default:
- NOTREACHED();
- }
-
- int64 wait = t.InMilliseconds();
- DCHECK(wait >= 0);
- return wait;
-}
-
-TimeDelta URLFetcherProtectEntry::AntiOverload() {
- TimeDelta sw = TimeDelta::FromMilliseconds(sliding_window_period_);
- TimeTicks now = TimeTicks::Now();
- // Estimate when the next request will be sent.
- release_time_ = now;
- if (send_log_.size() > 0) {
- release_time_ = std::max(release_time_, send_log_.back());
- }
- // Checks if there are too many send events in recent time.
- if (send_log_.size() >= static_cast<unsigned>(max_send_threshold_)) {
- release_time_ = std::max(release_time_, send_log_.front() + sw);
- }
- // Logs the new send event.
- send_log_.push(release_time_);
- // Drops the out-of-date events in the event list.
- while (!send_log_.empty() &&
- (send_log_.front() + sw <= send_log_.back())) {
- send_log_.pop();
- }
- return release_time_ - now;
-}
-
-TimeDelta URLFetcherProtectEntry::ResetBackoff() {
- timeout_period_ = initial_timeout_;
- release_time_ = TimeTicks::Now();
- return TimeDelta::FromMilliseconds(0);
-}
-
-TimeDelta URLFetcherProtectEntry::IncreaseBackoff() {
- TimeTicks now = TimeTicks::Now();
-
- release_time_ = std::max(release_time_, now) +
- TimeDelta::FromMilliseconds(timeout_period_);
-
- // Calculates the new backoff time.
- timeout_period_ = static_cast<int>
- (multiplier_ * timeout_period_ + constant_factor_);
- if (maximum_timeout_ && timeout_period_ > maximum_timeout_)
- timeout_period_ = maximum_timeout_;
-
- return release_time_ - now;
-}
-
-// URLFetcherProtectManager --------------------------------------------------
-
-// static
-scoped_ptr<URLFetcherProtectManager> URLFetcherProtectManager::protect_manager_;
-Lock URLFetcherProtectManager::lock_;
-
-URLFetcherProtectManager::~URLFetcherProtectManager() {
- // Deletes all entries
- ProtectService::iterator i;
- for (i = services_.begin(); i != services_.end(); ++i) {
- if (i->second)
- delete i->second;
- }
-}
-
-// static
-URLFetcherProtectManager* URLFetcherProtectManager::GetInstance() {
- AutoLock lock(lock_);
-
- if (protect_manager_.get() == NULL) {
- protect_manager_.reset(new URLFetcherProtectManager());
- }
- return protect_manager_.get();
-}
-
-URLFetcherProtectEntry* URLFetcherProtectManager::Register(
- const std::string& id) {
- AutoLock lock(lock_);
-
- ProtectService::iterator i = services_.find(id);
-
- if (i != services_.end()) {
- // The entry exists.
- return i->second;
- }
-
- // Creates a new entry.
- URLFetcherProtectEntry* entry = new URLFetcherProtectEntry();
- services_[id] = entry;
- return entry;
-}
-
-URLFetcherProtectEntry* URLFetcherProtectManager::Register(
- const std::string& id, URLFetcherProtectEntry* entry) {
- AutoLock lock(lock_);
-
- ProtectService::iterator i = services_.find(id);
- if (i != services_.end()) {
- // The entry exists.
- delete i->second;
- }
-
- services_[id] = entry;
- return entry;
-}
-
-URLFetcherProtectManager::URLFetcherProtectManager() {}
diff --git a/chrome/common/net/url_fetcher_protect.h b/chrome/common/net/url_fetcher_protect.h
index 6372640..e69de29 100644
--- a/chrome/common/net/url_fetcher_protect.h
+++ b/chrome/common/net/url_fetcher_protect.h
@@ -1,152 +0,0 @@
-// 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.
-//
-// This file implements backoff in the suggest system so that we don't
-// DOS the Suggest servers when using URLFetcher.
-
-#ifndef CHROME_COMMON_NET_URL_FETCHER_PROTECT_H_
-#define CHROME_COMMON_NET_URL_FETCHER_PROTECT_H_
-#pragma once
-
-#include <map>
-#include <queue>
-#include <string>
-
-#include "base/lock.h"
-#include "base/scoped_ptr.h"
-#include "base/time.h"
-
-
-// This class is used to manage one service's rate protection. It maintains
-// a queue of connection successes and failures and analyzes the requests
-// over some period of time, in order to deduce the backoff time of every
-// request.
-// The backoff algorithm consists of two parts. Firstly, avoid too many
-// send events in a sliding window. That will prevent traffic overload.
-// Secondly, exponential backoff is used when receiving an error message
-// from server. Exponential backoff period is calculated using the following
-// formula:
-//
-// initial backoff time (the first time to receive error)
-// backoff = k * current_backoff + c (the second, third, ... error)
-// maximum backoff time (when backoff > maximum backoff time)
-//
-// where |k| is the multiplier, and |c| is the constant factor.
-class URLFetcherProtectEntry {
- public:
- enum EventType {
- SEND, // request will be sent out
- SUCCESS, // successful response
- FAILURE // no response or error
- };
-
- URLFetcherProtectEntry();
- URLFetcherProtectEntry(int sliding_window_period, int max_send_threshold,
- int max_retries, int initial_timeout,
- double multiplier, int constant_factor,
- int maximum_timeout);
-
-
- virtual ~URLFetcherProtectEntry();
-
- // When a connection event happens, log it to the queue, and recalculate
- // the timeout period. It returns the backoff time, in milliseconds, that
- // indicates to the sender how long should it wait before sending the request.
- // If the request is allowed to be sent immediately, the backoff time is 0.
- int64 UpdateBackoff(EventType event_type);
-
- // Returns the max retries allowed.
- int max_retries() const {
- return max_retries_;
- }
-
- // Sets the max retries.
- void SetMaxRetries(int max_retries) {
- max_retries_ = max_retries;
- }
-
- private:
- // When a request comes, calculate the release time for it.
- // Returns the backoff time before sending.
- base::TimeDelta AntiOverload();
- // Resets backoff when service is ok.
- // Returns the backoff time before sending.
- base::TimeDelta ResetBackoff();
- // Calculates new backoff when encountering a failure.
- // Returns the backoff time before sending.
- base::TimeDelta IncreaseBackoff();
-
- // Default parameters. Time is in milliseconds.
- static const int kDefaultSlidingWindowPeriod;
- static const int kDefaultMaxSendThreshold;
- static const int kDefaultMaxRetries;
- static const int kDefaultInitialTimeout;
- static const double kDefaultMultiplier;
- static const int kDefaultConstantFactor;
- static const int kDefaultMaximumTimeout;
-
- // time to consider events when checking backoff
- int sliding_window_period_;
-
- // maximum number of requests allowed in sliding window period
- int max_send_threshold_;
- // maximum retris allowed
- int max_retries_;
-
- // initial timeout on first failure
- int initial_timeout_;
- // factor by which to multiply on exponential backoff (e.g., 2.0)
- double multiplier_;
- // constant time term to add to each attempt
- int constant_factor_;
- // maximum amount of time between requests
- int maximum_timeout_;
-
- // current exponential backoff period
- int timeout_period_;
- // time that protection is scheduled to end
- base::TimeTicks release_time_;
-
- // Sets up a lock to ensure thread safe.
- Lock lock_;
-
- // A list of the recent send events. We ues them to decide whether
- // there are too many requests sent in sliding window.
- std::queue<base::TimeTicks> send_log_;
-
- DISALLOW_COPY_AND_ASSIGN(URLFetcherProtectEntry);
-};
-
-
-// This singleton class is used to manage all protect entries.
-// Now we use the host name as service id.
-class URLFetcherProtectManager {
- public:
- ~URLFetcherProtectManager();
-
- // Returns the global instance of this class.
- static URLFetcherProtectManager* GetInstance();
-
- // Registers a new entry in this service. If the entry already exists,
- // just returns it. Ownership of the return object remains with the manager.
- URLFetcherProtectEntry* Register(const std::string& id);
- // Always registers the entry even when it exists; any existing entry for this
- // id will be deleted and existing references to it will become invalid.
- // Ownership of the return object remains with the manager.
- URLFetcherProtectEntry* Register(const std::string& id,
- URLFetcherProtectEntry* entry);
-
- private:
- URLFetcherProtectManager();
-
- typedef std::map<const std::string, URLFetcherProtectEntry*> ProtectService;
-
- static Lock lock_;
- static scoped_ptr<URLFetcherProtectManager> protect_manager_;
- ProtectService services_;
-
- DISALLOW_COPY_AND_ASSIGN(URLFetcherProtectManager);
-};
-
-#endif // CHROME_COMMON_NET_URL_FETCHER_PROTECT_H_
diff --git a/chrome/common/net/url_fetcher_unittest.cc b/chrome/common/net/url_fetcher_unittest.cc
index 65fb3c5..c231dca 100644
--- a/chrome/common/net/url_fetcher_unittest.cc
+++ b/chrome/common/net/url_fetcher_unittest.cc
@@ -8,11 +8,11 @@
#include "build/build_config.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/net/url_fetcher.h"
-#include "chrome/common/net/url_fetcher_protect.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "net/http/http_response_headers.h"
-#include "net/url_request/url_request_unittest.h"
#include "net/test/test_server.h"
+#include "net/url_request/url_request_throttler_manager.h"
+#include "net/url_request/url_request_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(USE_NSS)
@@ -228,6 +228,20 @@ class CancelTestURLRequestContextGetter : public URLRequestContextGetter {
scoped_refptr<URLRequestContext> context_;
};
+// Version of URLFetcherTest that tests retying the same request twice.
+class URLFetcherMultipleAttemptTest : public URLFetcherTest {
+ public:
+ // URLFetcher::Delegate
+ virtual void OnURLFetchComplete(const URLFetcher* source,
+ const GURL& url,
+ const URLRequestStatus& status,
+ int response_code,
+ const ResponseCookies& cookies,
+ const std::string& data);
+ private:
+ std::string data_;
+};
+
// Wrapper that lets us call CreateFetcher() on a thread of our choice. We
// could make URLFetcherTest refcounted and use PostTask(FROM_HERE.. ) to call
// CreateFetcher() directly, but the ownership of the URLFetcherTest is a bit
@@ -312,6 +326,7 @@ void URLFetcherProtectTest::CreateFetcher(const GURL& url) {
fetcher_->set_request_context(new TestURLRequestContextGetter(
io_message_loop_proxy()));
start_time_ = Time::Now();
+ fetcher_->set_max_retries(11);
fetcher_->Start();
}
@@ -338,7 +353,7 @@ void URLFetcherProtectTest::OnURLFetchComplete(const URLFetcher* source,
fetcher_->Start();
} else {
// We have already sent 20 requests continuously. And we expect that
- // it takes more than 1 second due to the overload pretection settings.
+ // it takes more than 1 second due to the overload protection settings.
EXPECT_TRUE(Time::Now() - start_time_ >= one_second);
URLFetcherTest::OnURLFetchComplete(source, url, status, response_code,
cookies, data);
@@ -352,6 +367,7 @@ void URLFetcherProtectTestPassedThrough::CreateFetcher(const GURL& url) {
io_message_loop_proxy()));
fetcher_->set_automatically_retry_on_5xx(false);
start_time_ = Time::Now();
+ fetcher_->set_max_retries(11);
fetcher_->Start();
}
@@ -419,6 +435,7 @@ void URLFetcherCancelTest::CreateFetcher(const GURL& url) {
CancelTestURLRequestContextGetter* context_getter =
new CancelTestURLRequestContextGetter(io_message_loop_proxy());
fetcher_->set_request_context(context_getter);
+ fetcher_->set_max_retries(2);
fetcher_->Start();
// We need to wait for the creation of the URLRequestContext, since we
// rely on it being destroyed as a signal to end the test.
@@ -445,6 +462,31 @@ void URLFetcherCancelTest::CancelRequest() {
// did not work.
}
+void URLFetcherMultipleAttemptTest::OnURLFetchComplete(
+ const URLFetcher* source,
+ const GURL& url,
+ const URLRequestStatus& status,
+ int response_code,
+ const ResponseCookies& cookies,
+ const std::string& data) {
+ EXPECT_TRUE(status.is_success());
+ EXPECT_EQ(200, response_code); // HTTP OK
+ EXPECT_FALSE(data.empty());
+ if (!data.empty() && data_.empty()) {
+ data_ = data;
+ fetcher_->Start();
+ } else {
+ EXPECT_EQ(data, data_);
+ delete fetcher_; // Have to delete this here and not in the destructor,
+ // because the destructor won't necessarily run on the
+ // same thread that CreateFetcher() did.
+
+ io_message_loop_proxy()->PostTask(FROM_HERE, new MessageLoop::QuitTask());
+ // If the current message loop is not the IO loop, it will be shut down when
+ // the main loop returns and this thread subsequently goes out of scope.
+ }
+}
+
TEST_F(URLFetcherTest, SameThreadsTest) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
@@ -500,14 +542,16 @@ TEST_F(URLFetcherProtectTest, Overload) {
// Registers an entry for test url. It only allows 3 requests to be sent
// in 200 milliseconds.
- URLFetcherProtectManager* manager = URLFetcherProtectManager::GetInstance();
- URLFetcherProtectEntry* entry =
- new URLFetcherProtectEntry(200, 3, 11, 1, 2.0, 0, 256);
- manager->Register(url.host(), entry);
+ scoped_refptr<net::URLRequestThrottlerEntry> entry(
+ new net::URLRequestThrottlerEntry(200, 3, 1, 0, 2.0, 0.0, 256));
+ net::URLRequestThrottlerManager::GetInstance()->OverrideEntryForTests(
+ url, entry);
CreateFetcher(url);
MessageLoop::current()->Run();
+
+ net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url);
}
TEST_F(URLFetcherProtectTest, ServerUnavailable) {
@@ -520,14 +564,16 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) {
// new_backoff = 2.0 * old_backoff + 0
// and maximum backoff time is 256 milliseconds.
// Maximum retries allowed is set to 11.
- URLFetcherProtectManager* manager = URLFetcherProtectManager::GetInstance();
- URLFetcherProtectEntry* entry =
- new URLFetcherProtectEntry(200, 3, 11, 1, 2.0, 0, 256);
- manager->Register(url.host(), entry);
+ scoped_refptr<net::URLRequestThrottlerEntry> entry(
+ new net::URLRequestThrottlerEntry(200, 3, 1, 0, 2.0, 0.0, 256));
+ net::URLRequestThrottlerManager::GetInstance()->OverrideEntryForTests(
+ url, entry);
CreateFetcher(url);
MessageLoop::current()->Run();
+
+ net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url);
}
TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) {
@@ -538,20 +584,21 @@ TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) {
// Registers an entry for test url. The backoff time is calculated by:
// new_backoff = 2.0 * old_backoff + 0
- // and maximum backoff time is 256 milliseconds.
+ // and maximum backoff time is 150000 milliseconds.
// Maximum retries allowed is set to 11.
- URLFetcherProtectManager* manager = URLFetcherProtectManager::GetInstance();
+ scoped_refptr<net::URLRequestThrottlerEntry> entry(
+ new net::URLRequestThrottlerEntry(200, 3, 100, 0, 2.0, 0.0, 150000));
// Total time if *not* for not doing automatic backoff would be 150s.
// In reality it should be "as soon as server responds".
- URLFetcherProtectEntry* entry =
- new URLFetcherProtectEntry(200, 3, 11, 100, 2.0, 0, 150000);
- manager->Register(url.host(), entry);
+ net::URLRequestThrottlerManager::GetInstance()->OverrideEntryForTests(
+ url, entry);
CreateFetcher(url);
MessageLoop::current()->Run();
-}
+ net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url);
+}
TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) {
net::TestServer::HTTPSOptions https_options(
@@ -573,10 +620,10 @@ TEST_F(URLFetcherCancelTest, ReleasesContext) {
// new_backoff = 2.0 * old_backoff + 0
// The initial backoff is 2 seconds and maximum backoff is 4 seconds.
// Maximum retries allowed is set to 2.
- URLFetcherProtectManager* manager = URLFetcherProtectManager::GetInstance();
- URLFetcherProtectEntry* entry =
- new URLFetcherProtectEntry(200, 3, 2, 2000, 2.0, 0, 4000);
- manager->Register(url.host(), entry);
+ scoped_refptr<net::URLRequestThrottlerEntry> entry(
+ new net::URLRequestThrottlerEntry(200, 3, 2000, 0, 2.0, 0.0, 4000));
+ net::URLRequestThrottlerManager::GetInstance()->OverrideEntryForTests(
+ url, entry);
// Create a separate thread that will create the URLFetcher. The current
// (main) thread will do the IO, and when the fetch is complete it will
@@ -588,6 +635,8 @@ TEST_F(URLFetcherCancelTest, ReleasesContext) {
t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url));
MessageLoop::current()->Run();
+
+ net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url);
}
TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
@@ -597,22 +646,14 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
GURL url(test_server.GetURL("files/server-unavailable.html"));
// Register an entry for test url.
- //
- // Ideally we would mock URLFetcherProtectEntry to return XXX seconds
- // in response to entry->UpdateBackoff(SEND).
- //
- // Unfortunately this function is time sensitive, so we fudge some numbers
- // to make it at least somewhat likely to have a non-zero deferred
- // delay when running.
- //
- // Using a sliding window of 2 seconds, and max of 1 request, under a fast
+ // Using a sliding window of 4 seconds, and max of 1 request, under a fast
// run we expect to have a 4 second delay when posting the Start task.
- URLFetcherProtectManager* manager = URLFetcherProtectManager::GetInstance();
- URLFetcherProtectEntry* entry =
- new URLFetcherProtectEntry(2000, 1, 2, 2000, 2.0, 0, 4000);
- EXPECT_EQ(0, entry->UpdateBackoff(URLFetcherProtectEntry::SEND));
- entry->UpdateBackoff(URLFetcherProtectEntry::SEND); // Returns about 2000.
- manager->Register(url.host(), entry);
+ scoped_refptr<net::URLRequestThrottlerEntry> entry(
+ new net::URLRequestThrottlerEntry(4000, 1, 2000, 0, 2.0, 0.0, 4000));
+ net::URLRequestThrottlerManager::GetInstance()->OverrideEntryForTests(
+ url, entry);
+ // Fake that a request has just started.
+ entry->ReserveSendingTimeForNextRequest(base::TimeTicks());
// The next request we try to send will be delayed by ~4 seconds.
// The slower the test runs, the less the delay will be (since it takes the
@@ -623,6 +664,20 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url));
MessageLoop::current()->Run();
+
+ net::URLRequestThrottlerManager::GetInstance()->EraseEntryForTests(url);
+}
+
+TEST_F(URLFetcherMultipleAttemptTest, SameData) {
+ net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ ASSERT_TRUE(test_server.Start());
+
+ // Create the fetcher on the main thread. Since IO will happen on the main
+ // thread, this will test URLFetcher's ability to do everything on one
+ // thread.
+ CreateFetcher(test_server.GetURL("defaultresponse"));
+
+ MessageLoop::current()->Run();
}
} // namespace.
diff --git a/chrome/common/net/url_request_intercept_job.h b/chrome/common/net/url_request_intercept_job.h
index 3835fe5..6d47bfc 100644
--- a/chrome/common/net/url_request_intercept_job.h
+++ b/chrome/common/net/url_request_intercept_job.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// 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.
@@ -14,18 +14,21 @@
#include "chrome/common/chrome_plugin_util.h"
#include "chrome/common/notification_registrar.h"
-class ChromePluginLib;
+namespace net {
class URLRequest;
+} // namespace net
+
+class ChromePluginLib;
// A request job that handles network requests intercepted by a Chrome plugin.
-class URLRequestInterceptJob
- : public URLRequestJob, public NotificationObserver {
+class URLRequestInterceptJob : public net::URLRequestJob,
+ public NotificationObserver {
public:
static URLRequestInterceptJob* FromCPRequest(CPRequest* request) {
return ScopableCPRequest::GetData<URLRequestInterceptJob*>(request);
}
- URLRequestInterceptJob(URLRequest* request, ChromePluginLib* plugin,
+ URLRequestInterceptJob(net::URLRequest* request, ChromePluginLib* plugin,
ScopableCPRequest* cprequest);
virtual ~URLRequestInterceptJob();
diff --git a/chrome/common/notification_type.h b/chrome/common/notification_type.h
index ba8280d..e2da69c 100644
--- a/chrome/common/notification_type.h
+++ b/chrome/common/notification_type.h
@@ -670,6 +670,13 @@ class NotificationType {
// details the TopSites.
TOP_SITES_LOADED,
+ // Sent by TopSites when it has finished updating its most visited URLs
+ // cache after querying the history service. The source is the TopSites and
+ // the details a CancelableRequestProvider::Handle from the history service
+ // query.
+ // Used only in testing.
+ TOP_SITES_UPDATED,
+
// Thumbnails---------------------------------------------------------------
// Sent by the ThumbnailGenerator whenever a render widget host
@@ -735,9 +742,10 @@ class NotificationType {
// should be the UI thread.
DEFAULT_REQUEST_CONTEXT_AVAILABLE,
- // A new web resource has been made available. Source is the
- // WebResourceService, and the details are NoDetails.
- WEB_RESOURCE_AVAILABLE,
+ // The state of a web resource has been changed. A resource may have been
+ // added, removed, or altered. Source is WebResourceService, and the
+ // details are NoDetails.
+ WEB_RESOURCE_STATE_CHANGED,
// Autocomplete ------------------------------------------------------------
@@ -914,6 +922,10 @@ class NotificationType {
// are no details.
EXTENSION_PAGE_ACTION_COUNT_CHANGED,
+ // Sent when a browser action's visibility has changed. The source is the
+ // ExtensionPrefs* that changed. The details are a Extension*.
+ EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
+
// Sent when a page action's visibility has changed. The source is the
// ExtensionAction* that changed. The details are a TabContents*.
EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
@@ -943,6 +955,10 @@ class NotificationType {
// session. The source is the profile.
EXTENSION_OMNIBOX_INPUT_ENTERED,
+ // Sent when an omnibox extension has updated the default suggestion. The
+ // source is the profile.
+ EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
+
// Sent when an extension changes a preference value. The source is the
// profile, and the details are an ExtensionPrefStore::ExtensionPrefDetails
// object.
@@ -1028,6 +1044,12 @@ class NotificationType {
// if only suspected bad modules were found.
MODULE_INCOMPATIBILITY_DETECTED,
+ // Background App Tracking Notifications -----------------------------------
+ // Sent when the state of the background page tracker has changed (the
+ // number of unacknowledged background pages have changed). Source is the
+ // BackgroundPageTracker and there are no Details.
+ BACKGROUND_PAGE_TRACKER_CHANGED,
+
// Accessibility Notifications ---------------------------------------------
// Notification that a window in the browser UI (not the web content)
@@ -1112,8 +1134,9 @@ class NotificationType {
// The syncer requires a passphrase to decrypt sensitive updates. This
// notification is sent when the first sensitive data type is setup by the
// user as well as anytime any the passphrase is changed in another synced
- // client. The source is the SyncBackendHost wanting a passphrase. No
- // details.
+ // client. The source is the SyncBackendHost wanting a passphrase. The
+ // details are a boolean: true if the passphrase is required for decryption,
+ // false if only required for encryption.
SYNC_PASSPHRASE_REQUIRED,
// Sent when the passphrase provided by the user is accepted. After this
@@ -1272,6 +1295,10 @@ class NotificationType {
// that the policy subsystem uses to fetch policy from the cloud.
DEVICE_TOKEN_AVAILABLE,
+ // This notification is sent whenever cloud policies are fetched and
+ // updated. The detail of this notification is not used.
+ CLOUD_POLICY_UPDATE,
+
// Count (must be last) ----------------------------------------------------
// Used to determine the number of notification types. Not valid as
// a type parameter when registering for or posting notifications.
diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc
index e152728..0434197 100644
--- a/chrome/common/plugin_messages.cc
+++ b/chrome/common/plugin_messages.cc
@@ -22,7 +22,8 @@ PluginMsg_Init_Params::~PluginMsg_Init_Params() {
PluginHostMsg_URLRequest_Params::PluginHostMsg_URLRequest_Params()
: notify_id(-1),
- popups_allowed(false) {
+ popups_allowed(false),
+ notify_redirects(false) {
}
PluginHostMsg_URLRequest_Params::~PluginHostMsg_URLRequest_Params() {
@@ -123,6 +124,7 @@ void ParamTraits<PluginHostMsg_URLRequest_Params>::Write(Message* m,
WriteParam(m, p.buffer);
WriteParam(m, p.notify_id);
WriteParam(m, p.popups_allowed);
+ WriteParam(m, p.notify_redirects);
}
bool ParamTraits<PluginHostMsg_URLRequest_Params>::Read(const Message* m,
@@ -134,7 +136,8 @@ bool ParamTraits<PluginHostMsg_URLRequest_Params>::Read(const Message* m,
ReadParam(m, iter, &p->target) &&
ReadParam(m, iter, &p->buffer) &&
ReadParam(m, iter, &p->notify_id) &&
- ReadParam(m, iter, &p->popups_allowed);
+ ReadParam(m, iter, &p->popups_allowed) &&
+ ReadParam(m, iter, &p->notify_redirects);
}
void ParamTraits<PluginHostMsg_URLRequest_Params>::Log(const param_type& p,
@@ -151,6 +154,8 @@ void ParamTraits<PluginHostMsg_URLRequest_Params>::Log(const param_type& p,
LogParam(p.notify_id, l);
l->append(", ");
LogParam(p.popups_allowed, l);
+ l->append(", ");
+ LogParam(p.notify_redirects, l);
l->append(")");
}
diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h
index 86df200..3935fa8 100644
--- a/chrome/common/plugin_messages.h
+++ b/chrome/common/plugin_messages.h
@@ -56,6 +56,7 @@ struct PluginHostMsg_URLRequest_Params {
std::vector<char> buffer;
int notify_id;
bool popups_allowed;
+ bool notify_redirects;
};
struct PluginMsg_DidReceiveResponseParams {
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 6cee704..7ebfd58 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -243,9 +243,10 @@ IPC_BEGIN_MESSAGES(Plugin)
string16 /* text */)
#endif
- IPC_SYNC_MESSAGE_ROUTED2_0(PluginMsg_WillSendRequest,
+ IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_WillSendRequest,
unsigned long /* id */,
- GURL /* url */)
+ GURL /* url */,
+ int /* http_status_code */)
IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveResponse,
PluginMsg_DidReceiveResponseParams)
@@ -308,6 +309,11 @@ IPC_BEGIN_MESSAGES(Plugin)
gfx::PluginWindowHandle /* window */)
#endif
+ IPC_MESSAGE_CONTROL3(PluginMsg_ClearSiteData,
+ uint64, /* flags */
+ std::string, /* domain */
+ base::Time /* begin_time */)
+
IPC_END_MESSAGES(Plugin)
@@ -463,6 +469,13 @@ IPC_BEGIN_MESSAGES(PluginHost)
uint64 /* surface_id */)
#endif
+ IPC_MESSAGE_CONTROL1(PluginHostMsg_ClearSiteDataResult,
+ bool /* success */)
+
+ IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse,
+ bool /* allow */,
+ int /* resource_id */)
+
IPC_END_MESSAGES(PluginHost)
//-----------------------------------------------------------------------------
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 13006f5..b43b59a 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -119,6 +119,10 @@ const char kFormAutofillEnabled[] = "profile.form_autofill_enabled";
// Boolean that is true when SafeBrowsing is enabled.
const char kSafeBrowsingEnabled[] = "safebrowsing.enabled";
+// Boolean that is true when SafeBrowsing Malware Report is enabled.
+const char kSafeBrowsingReportingEnabled[] =
+ "safebrowsing.reporting_enabled";
+
// Boolean that is true when Suggest support is enabled.
const char kSearchSuggestEnabled[] = "search.suggest_enabled";
@@ -222,9 +226,6 @@ const char kInstantEnabledTime[] = "instant.enabled_time";
// that are used.
const char kInstantPromo[] = "instant.promo";
-// Type of instant. This is one of the enums defined in InstantController::TYPE.
-const char kInstantType[] = "instant.type";
-
#if defined(USE_NSS) || defined(USE_OPENSSL)
// Prefs for SSLConfigServicePref. Currently, these are only present on
// and used by NSS/OpenSSL using OSes.
@@ -413,6 +414,10 @@ const char kLabsMediaplayerEnabled[] = "settings.labs.mediaplayer";
// A boolean pref that turns on screen locker.
const char kEnableScreenLock[] = "settings.enable_screen_lock";
+// A boolean pref of whether to show mobile plan notifications.
+const char kShowPlanNotifications[] =
+ "settings.internet.mobile.show_plan_notifications";
+
#endif // defined(OS_CHROMEOS)
// The disabled messages in IPC logging.
@@ -755,10 +760,6 @@ const char kPreferencesWindowPlacement[] = "preferences.window_placement";
// renderer's in-memory cache of objects.
const char kMemoryCacheSize[] = "renderer.memory_cache.size";
-// Boolean that records if chrome should run in background mode when background
-// apps are installed.
-const char kBackgroundModeEnabled[] = "background_mode.enabled";
-
// Boolean that records if chrome has set "launch on startup" property for
// itself earlier and is allowed to reset it later, reducing likelihood of
// overriding user choices.
@@ -935,11 +936,14 @@ const char kNTPWebResourceCache[] = "ntp.web_resource_cache";
// Last time of update of web_resource_cache.
const char kNTPWebResourceCacheUpdate[] = "ntp.web_resource_cache_update";
-// Last server used to fill tips.
+// Serves resources for the NTP.
+const char kNTPWebResourceServer[] = "ntp.web_resource_server";
+
+// Serves tips for the NTP.
const char kNTPTipsResourceServer[] = "ntp.tips_resource_server";
-// Last server used to fill logo_resource_cache.
-const char kNTPLogoResourceServer[] = "ntp.alt_logo_resource_server";
+// Serves dates to determine display of elements on the NTP.
+const char kNTPDateResourceServer[] = "ntp.date_resource_server";
// Which sections should be visible on the new tab page
// 1 - Show the most visited sites in a grid
@@ -957,6 +961,17 @@ const char kNTPPrefVersion[] = "ntp.pref_version";
const char kNTPCustomLogoStart[] = "ntp.alt_logo_start";
const char kNTPCustomLogoEnd[] = "ntp.alt_logo_end";
+// Dates between which the NTP should show a promotional line downloaded
+// from the promo server.
+const char kNTPPromoStart[] = "ntp.promo_start";
+const char kNTPPromoEnd[] = "ntp.promo_end";
+
+// Promo line from server.
+const char kNTPPromoLine[] = "ntp.promo_line";
+
+// True if user has explicitly closed the promo line.
+const char kNTPPromoClosed[] = "ntp.promo_closed";
+
const char kDevToolsDisabled[] = "devtools.disabled";
// A boolean specifying whether dev tools window should be opened docked.
@@ -1111,4 +1126,8 @@ const char kManagedDefaultPluginsSetting[] =
const char kManagedDefaultPopupsSetting[] =
"profile.managed_default_content_settings.popups";
+// Dictionary for storing the set of known background pages (keys are extension
+// IDs of background page owners, value is a boolean that is true if the user
+// needs to acknowledge this page.
+const char kKnownBackgroundPages[] = "background_pages.known";
} // namespace prefs
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index c4d6af1..621cbe3 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -57,6 +57,7 @@ extern const char kPasswordManagerEnabled[];
extern const char kPasswordManagerAllowShowPasswords[];
extern const char kFormAutofillEnabled[]; // OBSOLETE
extern const char kSafeBrowsingEnabled[];
+extern const char kSafeBrowsingReportingEnabled[];
extern const char kSearchSuggestEnabled[];
extern const char kCookieBehavior[]; // OBSOLETE
extern const char kDefaultSearchProviderEnabled[];
@@ -83,7 +84,6 @@ extern const char kInstantEnabled[];
extern const char kInstantEnabledOnce[];
extern const char kInstantEnabledTime[];
extern const char kInstantPromo[];
-extern const char kInstantType[];
#if defined(USE_NSS) || defined(USE_OPENSSL)
extern const char kCertRevocationCheckingEnabled[];
extern const char kSSL2Enabled[];
@@ -156,6 +156,7 @@ extern const char kAccessibilityEnabled[];
extern const char kLabsAdvancedFilesystemEnabled[];
extern const char kLabsMediaplayerEnabled[];
extern const char kEnableScreenLock[];
+extern const char kShowPlanNotifications[];
#endif
extern const char kIpcDisabledMessages[];
extern const char kShowHomeButton[];
@@ -274,7 +275,6 @@ extern const char kKeywordEditorWindowPlacement[];
extern const char kPreferencesWindowPlacement[];
extern const char kMemoryCacheSize[];
-extern const char kBackgroundModeEnabled[];
extern const char kLaunchOnStartupResetAllowed[];
extern const char kDownloadDefaultDirectory[];
@@ -340,16 +340,22 @@ extern const char kExtensionBlacklistUpdateVersion[];
extern const char kExtensionSidebarWidth[];
+extern const char kNTPTipsResourceServer[];
+
extern const char kNTPMostVisitedURLsBlacklist[];
extern const char kNTPMostVisitedPinnedURLs[];
extern const char kNTPWebResourceCache[];
extern const char kNTPWebResourceCacheUpdate[];
-extern const char kNTPTipsResourceServer[];
-extern const char kNTPLogoResourceServer[];
+extern const char kNTPWebResourceServer[];
+extern const char kNTPDateResourceServer[];
extern const char kNTPShownSections[];
extern const char kNTPPrefVersion[];
extern const char kNTPCustomLogoStart[];
extern const char kNTPCustomLogoEnd[];
+extern const char kNTPPromoStart[];
+extern const char kNTPPromoEnd[];
+extern const char kNTPPromoLine[];
+extern const char kNTPPromoClosed[];
extern const char kDevToolsDisabled[];
extern const char kDevToolsOpenDocked[];
@@ -422,6 +428,8 @@ extern const char kAuthServerWhitelist[];
extern const char kAuthNegotiateDelegateWhitelist[];
extern const char kGSSAPILibraryName[];
+extern const char kKnownBackgroundPages[];
+
} // namespace prefs
#endif // CHROME_COMMON_PREF_NAMES_H_
diff --git a/chrome/common/property_bag.h b/chrome/common/property_bag.h
index d0d7c89..0a44892 100644
--- a/chrome/common/property_bag.h
+++ b/chrome/common/property_bag.h
@@ -36,11 +36,11 @@ class PropertyAccessorBase;
//
// void doit(SomeObjectThatImplementsPropertyBag* object) {
// PropertyAccessor<int>* accessor = my_accessor();
-// int* property = accessor.GetProperty(object);
+// int* property = accessor->GetProperty(object);
// if (property)
// ... use property ...
//
-// accessor.SetProperty(object, 22);
+// accessor->SetProperty(object, 22);
// }
class PropertyBag {
public:
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index e6d3126..be20600 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -94,20 +94,23 @@ void ParamTraits<webkit_glue::FormField>::Write(Message* m,
WriteParam(m, p.name());
WriteParam(m, p.value());
WriteParam(m, p.form_control_type());
- WriteParam(m, p.size());
+ WriteParam(m, p.max_length());
+ WriteParam(m, p.is_autofilled());
WriteParam(m, p.option_strings());
}
bool ParamTraits<webkit_glue::FormField>::Read(const Message* m, void** iter,
param_type* p) {
string16 label, name, value, form_control_type;
- int size = 0;
+ int max_length = 0;
+ bool is_autofilled;
std::vector<string16> options;
bool result = ReadParam(m, iter, &label);
result = result && ReadParam(m, iter, &name);
result = result && ReadParam(m, iter, &value);
result = result && ReadParam(m, iter, &form_control_type);
- result = result && ReadParam(m, iter, &size);
+ result = result && ReadParam(m, iter, &max_length);
+ result = result && ReadParam(m, iter, &is_autofilled);
result = result && ReadParam(m, iter, &options);
if (!result)
return false;
@@ -116,7 +119,8 @@ bool ParamTraits<webkit_glue::FormField>::Read(const Message* m, void** iter,
p->set_name(name);
p->set_value(value);
p->set_form_control_type(form_control_type);
- p->set_size(size);
+ p->set_max_length(max_length);
+ p->set_autofilled(is_autofilled);
p->set_option_strings(options);
return true;
}
@@ -428,6 +432,8 @@ void ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Write(
Message* m, const param_type& p) {
WriteParam(m, p.get() != NULL);
if (p.get()) {
+ WriteParam(m, p->http_status_code);
+ WriteParam(m, p->http_status_text);
WriteParam(m, p->request_headers);
WriteParam(m, p->response_headers);
}
@@ -442,6 +448,8 @@ bool ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Read(
return true;
*r = new webkit_glue::ResourceDevToolsInfo();
return
+ ReadParam(m, iter, &(*r)->http_status_code) &&
+ ReadParam(m, iter, &(*r)->http_status_text) &&
ReadParam(m, iter, &(*r)->request_headers) &&
ReadParam(m, iter, &(*r)->response_headers);
}
@@ -721,12 +729,14 @@ void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) {
WriteParam(m, p.user_style_sheet_enabled);
WriteParam(m, p.user_style_sheet_location);
WriteParam(m, p.author_and_user_styles_enabled);
+ WriteParam(m, p.frame_flattening_enabled);
WriteParam(m, p.allow_universal_access_from_file_urls);
WriteParam(m, p.allow_file_access_from_file_urls);
WriteParam(m, p.experimental_webgl_enabled);
WriteParam(m, p.show_composited_layer_borders);
WriteParam(m, p.accelerated_compositing_enabled);
WriteParam(m, p.accelerated_2d_canvas_enabled);
+ WriteParam(m, p.accelerated_layers_enabled);
WriteParam(m, p.memory_info_enabled);
}
@@ -770,12 +780,14 @@ bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter,
ReadParam(m, iter, &p->user_style_sheet_enabled) &&
ReadParam(m, iter, &p->user_style_sheet_location) &&
ReadParam(m, iter, &p->author_and_user_styles_enabled) &&
+ ReadParam(m, iter, &p->frame_flattening_enabled) &&
ReadParam(m, iter, &p->allow_universal_access_from_file_urls) &&
ReadParam(m, iter, &p->allow_file_access_from_file_urls) &&
ReadParam(m, iter, &p->experimental_webgl_enabled) &&
ReadParam(m, iter, &p->show_composited_layer_borders) &&
ReadParam(m, iter, &p->accelerated_compositing_enabled) &&
ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) &&
+ ReadParam(m, iter, &p->accelerated_layers_enabled) &&
ReadParam(m, iter, &p->memory_info_enabled);
}
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 6f6b6cd..2dba9ae 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -165,19 +165,12 @@ IPC_BEGIN_MESSAGES(View)
// requested pages for print preview.
IPC_MESSAGE_ROUTED0(ViewMsg_PrintPreview)
-#if defined(OS_MACOSX) || defined(OS_WIN)
// Sends back to the browser the rendered "printed page" for preview that was
// requested by a ViewMsg_PrintPage message or from scripted printing. The
// memory handle in this message is already valid in the browser process.
- IPC_MESSAGE_ROUTED1(ViewHostMsg_PageReadyForPreview,
- ViewHostMsg_DidPrintPage_Params /* page content */)
-#else
- // Sends back to the browser the rendered "printed page" for preview that was
- // requested by a ViewMsg_PrintPage message or from scripted printing. The
- // memory handle in this message is already valid in the browser process.
- IPC_MESSAGE_ROUTED1(ViewHostMsg_PagesReadyForPreview,
+ IPC_MESSAGE_ROUTED2(ViewHostMsg_PagesReadyForPreview,
+ int /* document cookie */,
int /* fd in browser */)
-#endif
// Tells the renderer to dump as much memory as it can, perhaps because we
// have memory pressure or the renderer is (or will be) paged out. This
@@ -833,8 +826,9 @@ IPC_BEGIN_MESSAGES(View)
IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel)
IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize,
gfx::Rect /*search_box_bounds*/)
- IPC_MESSAGE_ROUTED1(ViewMsg_DetermineIfPageSupportsInstant,
- string16 /*value*/)
+ IPC_MESSAGE_ROUTED2(ViewMsg_DetermineIfPageSupportsInstant,
+ string16 /*value*/,
+ bool /* verbatim */)
// Used to tell the renderer not to add scrollbars with height and
// width below a threshold.
@@ -1314,10 +1308,10 @@ IPC_BEGIN_MESSAGES(ViewHost)
IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect,
ViewHostMsg_UpdateRect_Params)
- // Sent by the renderer when GPU compositing is enabled or disabled to notify
- // the browser whether or not is should do paiting.
- IPC_MESSAGE_ROUTED1(ViewHostMsg_GpuRenderingActivated,
- bool /* true if the GPU process renders to window */)
+ // Sent by the renderer when accelerated compositing is enabled or disabled to
+ // notify the browser whether or not is should do painting.
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing,
+ bool /* true if the accelerated compositor is actve */)
// Acknowledges receipt of a ViewMsg_HandleInputEvent message.
// Payload is a WebInputEvent::Type which is the type of the event, followed
@@ -1377,22 +1371,22 @@ IPC_BEGIN_MESSAGES(ViewHost)
ViewHostMsg_Resource_Request,
SyncLoadResult)
- // Used to set a cookie. The cookie is set asynchronously, but will be
+ // Used to set a cookie. The cookie is set asynchronously, but will be
// available to a subsequent ViewHostMsg_GetCookies request.
IPC_MESSAGE_ROUTED3(ViewHostMsg_SetCookie,
GURL /* url */,
GURL /* first_party_for_cookies */,
std::string /* cookie */)
- // Used to get cookies for the given URL. This may be blocked by a user
- // prompt to validate a previous SetCookie message.
+ // Used to get cookies for the given URL. This may block waiting for a
+ // previous SetCookie message to be processed.
IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetCookies,
GURL /* url */,
GURL /* first_party_for_cookies */,
std::string /* cookies */)
- // Used to get raw cookie information for the given URL. This may be blocked
- // by a user prompt to validate a previous SetCookie message.
+ // Used to get raw cookie information for the given URL. This may block
+ // waiting for a previous SetCookie message to be processed.
IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetRawCookies,
GURL /* url */,
GURL /* first_party_for_cookies */,
@@ -1404,6 +1398,13 @@ IPC_BEGIN_MESSAGES(ViewHost)
GURL /* url */,
std::string /* cookie_name */)
+ // Used to check if cookies are enabled for the given URL. This may block
+ // waiting for a previous SetCookie message to be processed.
+ IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_CookiesEnabled,
+ GURL /* url */,
+ GURL /* first_party_for_cookies */,
+ bool /* cookies_enabled */)
+
// Used to get the list of plugins
IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins,
bool /* refresh*/,
@@ -1905,6 +1906,10 @@ IPC_BEGIN_MESSAGES(ViewHost)
int32 /* page_id */,
WebApplicationInfo)
+ // Sent by the renderer to implement chrome.app.installApplication().
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_InstallApplication,
+ WebApplicationInfo)
+
// Provides the result from running OnMsgShouldClose. |proceed| matches the
// return value of the the frame's shouldClose method (which includes the
// onbeforeunload handler): true if the user decided to proceed with leaving
@@ -2087,7 +2092,7 @@ IPC_BEGIN_MESSAGES(ViewHost)
// Queries the browser for AutoFill suggestions for a form input field.
IPC_MESSAGE_ROUTED3(ViewHostMsg_QueryFormFieldAutoFill,
int /* id of this message */,
- bool /* field autofilled */,
+ webkit_glue::FormData /* the form */,
webkit_glue::FormField /* the form field */)
// Sent when the popup with AutoFill suggestions for a form is shown.
@@ -2095,9 +2100,10 @@ IPC_BEGIN_MESSAGES(ViewHost)
// Instructs the browser to fill in the values for a form using AutoFill
// profile data.
- IPC_MESSAGE_ROUTED3(ViewHostMsg_FillAutoFillFormData,
+ IPC_MESSAGE_ROUTED4(ViewHostMsg_FillAutoFillFormData,
int /* id of this message */,
webkit_glue::FormData /* the form */,
+ webkit_glue::FormField /* the form field */,
int /* profile unique ID */)
// Sent when a form is previewed or filled with AutoFill suggestions.
@@ -2461,20 +2467,15 @@ IPC_BEGIN_MESSAGES(ViewHost)
int32, /* idb_database_id */
string16 /* name */)
- // WebIDBDatabase::description() message.
- IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseDescription,
- int32, /* idb_database_id */
- string16 /* description */)
-
// WebIDBDatabase::version() message.
IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseVersion,
int32, /* idb_database_id */
string16 /* vesion */)
- // WebIDBDatabase::objectStores() message.
- IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseObjectStores,
+ // WebIDBDatabase::objectStoreNames() message.
+ IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseObjectStoreNames,
int32, /* idb_database_id */
- std::vector<string16> /* objectStores */)
+ std::vector<string16> /* objectStoreNames */)
// WebIDBDatabase::createObjectStore() message.
IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBDatabaseCreateObjectStore,
@@ -2633,10 +2634,11 @@ IPC_BEGIN_MESSAGES(ViewHost)
int32 /* idb_cursor_id */)
// IDBTransaction::ObjectStore message.
- IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_IDBTransactionObjectStore,
+ IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBTransactionObjectStore,
int32, /* transaction_id */
string16, /* name */
- int32 /* object_store_id */)
+ int32, /* object_store_id */
+ WebKit::WebExceptionCode /* ec */)
// WebIDBTransaction::mode() message.
IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBTransactionMode,
diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc
index 15b04d2..2b8638d 100644
--- a/chrome/common/render_messages_params.cc
+++ b/chrome/common/render_messages_params.cc
@@ -194,7 +194,8 @@ ViewHostMsg_IDBDatabaseCreateObjectStore_Params::
ViewHostMsg_IDBIndexOpenCursor_Params::ViewHostMsg_IDBIndexOpenCursor_Params()
: response_id_(0),
- key_flags_(0),
+ lower_open_(false),
+ upper_open_(false),
direction_(0),
idb_index_id_(0),
transaction_id_(0) {
@@ -230,7 +231,8 @@ ViewHostMsg_IDBObjectStoreCreateIndex_Params::
ViewHostMsg_IDBObjectStoreOpenCursor_Params::
ViewHostMsg_IDBObjectStoreOpenCursor_Params()
: response_id_(0),
- flags_(0),
+ lower_open_(false),
+ upper_open_(false),
direction_(0),
idb_object_store_id_(0),
transaction_id_(0) {
@@ -568,6 +570,7 @@ void ParamTraits<ViewMsg_Navigate_Params>::Write(Message* m,
WriteParam(m, p.state);
WriteParam(m, p.navigation_type);
WriteParam(m, p.request_time);
+ WriteParam(m, p.extra_headers);
}
bool ParamTraits<ViewMsg_Navigate_Params>::Read(const Message* m, void** iter,
@@ -582,7 +585,8 @@ bool ParamTraits<ViewMsg_Navigate_Params>::Read(const Message* m, void** iter,
ReadParam(m, iter, &p->transition) &&
ReadParam(m, iter, &p->state) &&
ReadParam(m, iter, &p->navigation_type) &&
- ReadParam(m, iter, &p->request_time);
+ ReadParam(m, iter, &p->request_time) &&
+ ReadParam(m, iter, &p->extra_headers);
}
void ParamTraits<ViewMsg_Navigate_Params>::Log(const param_type& p,
@@ -599,6 +603,8 @@ void ParamTraits<ViewMsg_Navigate_Params>::Log(const param_type& p,
LogParam(p.navigation_type, l);
l->append(", ");
LogParam(p.request_time, l);
+ l->append(", ");
+ LogParam(p.extra_headers, l);
l->append(")");
}
@@ -1328,9 +1334,10 @@ void ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params>::Write(
Message* m,
const param_type& p) {
WriteParam(m, p.response_id_);
- WriteParam(m, p.left_key_);
- WriteParam(m, p.right_key_);
- WriteParam(m, p.key_flags_);
+ WriteParam(m, p.lower_key_);
+ WriteParam(m, p.upper_key_);
+ WriteParam(m, p.lower_open_);
+ WriteParam(m, p.upper_open_);
WriteParam(m, p.direction_);
WriteParam(m, p.idb_index_id_);
WriteParam(m, p.transaction_id_);
@@ -1342,9 +1349,10 @@ bool ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params>::Read(
param_type* p) {
return
ReadParam(m, iter, &p->response_id_) &&
- ReadParam(m, iter, &p->left_key_) &&
- ReadParam(m, iter, &p->right_key_) &&
- ReadParam(m, iter, &p->key_flags_) &&
+ ReadParam(m, iter, &p->lower_key_) &&
+ ReadParam(m, iter, &p->upper_key_) &&
+ ReadParam(m, iter, &p->lower_open_) &&
+ ReadParam(m, iter, &p->upper_open_) &&
ReadParam(m, iter, &p->direction_) &&
ReadParam(m, iter, &p->idb_index_id_) &&
ReadParam(m, iter, &p->transaction_id_);
@@ -1356,11 +1364,13 @@ void ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params>::Log(
l->append("(");
LogParam(p.response_id_, l);
l->append(", ");
- LogParam(p.left_key_, l);
+ LogParam(p.lower_key_, l);
+ l->append(", ");
+ LogParam(p.upper_key_, l);
l->append(", ");
- LogParam(p.right_key_, l);
+ LogParam(p.lower_open_, l);
l->append(", ");
- LogParam(p.key_flags_, l);
+ LogParam(p.upper_open_, l);
l->append(", ");
LogParam(p.direction_, l);
l->append(", ");
@@ -1454,9 +1464,10 @@ void ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params>::Write(
Message* m,
const param_type& p) {
WriteParam(m, p.response_id_);
- WriteParam(m, p.left_key_);
- WriteParam(m, p.right_key_);
- WriteParam(m, p.flags_);
+ WriteParam(m, p.lower_key_);
+ WriteParam(m, p.upper_key_);
+ WriteParam(m, p.lower_open_);
+ WriteParam(m, p.upper_open_);
WriteParam(m, p.direction_);
WriteParam(m, p.idb_object_store_id_);
WriteParam(m, p.transaction_id_);
@@ -1468,9 +1479,10 @@ bool ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params>::Read(
param_type* p) {
return
ReadParam(m, iter, &p->response_id_) &&
- ReadParam(m, iter, &p->left_key_) &&
- ReadParam(m, iter, &p->right_key_) &&
- ReadParam(m, iter, &p->flags_) &&
+ ReadParam(m, iter, &p->lower_key_) &&
+ ReadParam(m, iter, &p->upper_key_) &&
+ ReadParam(m, iter, &p->lower_open_) &&
+ ReadParam(m, iter, &p->upper_open_) &&
ReadParam(m, iter, &p->direction_) &&
ReadParam(m, iter, &p->idb_object_store_id_) &&
ReadParam(m, iter, &p->transaction_id_);
@@ -1482,11 +1494,13 @@ void ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params>::Log(
l->append("(");
LogParam(p.response_id_, l);
l->append(", ");
- LogParam(p.left_key_, l);
+ LogParam(p.lower_key_, l);
+ l->append(", ");
+ LogParam(p.upper_key_, l);
l->append(", ");
- LogParam(p.right_key_, l);
+ LogParam(p.lower_open_, l);
l->append(", ");
- LogParam(p.flags_, l);
+ LogParam(p.upper_open_, l);
l->append(", ");
LogParam(p.direction_, l);
l->append(", ");
diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h
index ef5716b..64cf1e5 100644
--- a/chrome/common/render_messages_params.h
+++ b/chrome/common/render_messages_params.h
@@ -92,6 +92,7 @@ struct ViewMsg_Navigate_Params {
// The URL to send in the "Referer" header field. Can be empty if there is
// no referrer.
+ // TODO: consider folding this into extra_headers.
GURL referrer;
// The type of transition.
@@ -105,6 +106,9 @@ struct ViewMsg_Navigate_Params {
// The time the request was created
base::Time request_time;
+
+ // Extra headers (separated by \n) to send during the request.
+ std::string extra_headers;
};
// Current status of the audio output stream in the browser process. Browser
@@ -705,14 +709,17 @@ struct ViewHostMsg_IDBIndexOpenCursor_Params {
// The response should have this id.
int32 response_id_;
- // The serialized left key.
- IndexedDBKey left_key_;
+ // The serialized lower key.
+ IndexedDBKey lower_key_;
+
+ // The serialized upper key.
+ IndexedDBKey upper_key_;
- // The serialized right key.
- IndexedDBKey right_key_;
+ // Is the lower bound open?
+ bool lower_open_;
- // The key flags.
- int32 key_flags_;
+ // Is the upper bound open?
+ bool upper_open_;
// The direction of this cursor.
int32 direction_;
@@ -777,14 +784,17 @@ struct ViewHostMsg_IDBObjectStoreOpenCursor_Params {
// The response should have this id.
int32 response_id_;
- // The serialized left key.
- IndexedDBKey left_key_;
+ // The serialized lower key.
+ IndexedDBKey lower_key_;
+
+ // The serialized upper key.
+ IndexedDBKey upper_key_;
- // The serialized right key.
- IndexedDBKey right_key_;
+ // Is the lower bound open?
+ bool lower_open_;
- // The key flags.
- int32 flags_;
+ // Is the upper bound open?
+ bool upper_open_;
// The direction of this cursor.
int32 direction_;
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 0f192f1..1b2e175 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -395,20 +395,32 @@ void ResourceDispatcher::OnReceivedRedirect(
if (!request_info)
return;
+ int32 routing_id = message.routing_id();
bool has_new_first_party_for_cookies = false;
GURL new_first_party_for_cookies;
if (request_info->peer->OnReceivedRedirect(new_url, info,
&has_new_first_party_for_cookies,
&new_first_party_for_cookies)) {
- message_sender()->Send(
- new ViewHostMsg_FollowRedirect(message.routing_id(), request_id,
+ request_info->pending_redirect_message.reset(
+ new ViewHostMsg_FollowRedirect(routing_id, request_id,
has_new_first_party_for_cookies,
new_first_party_for_cookies));
+ if (!request_info->is_deferred) {
+ FollowPendingRedirect(request_id, *request_info);
+ }
} else {
- CancelPendingRequest(message.routing_id(), request_id);
+ CancelPendingRequest(routing_id, request_id);
}
}
+void ResourceDispatcher::FollowPendingRedirect(
+ int request_id,
+ PendingRequestInfo& request_info) {
+ IPC::Message* msg = request_info.pending_redirect_message.release();
+ if (msg)
+ message_sender()->Send(msg);
+}
+
void ResourceDispatcher::OnRequestComplete(int request_id,
const URLRequestStatus& status,
const std::string& security_info,
@@ -491,6 +503,9 @@ void ResourceDispatcher::SetDefersLoading(int request_id, bool value) {
request_info.is_deferred = value;
} else if (request_info.is_deferred) {
request_info.is_deferred = false;
+
+ FollowPendingRedirect(request_id, request_info);
+
MessageLoop::current()->PostTask(FROM_HERE,
method_factory_.NewRunnableMethod(
&ResourceDispatcher::FlushDeferredMessages, request_id));
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 475119f..3ca3492 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -12,6 +12,7 @@
#include <string>
#include "base/hash_tables.h"
+#include "base/linked_ptr.h"
#include "base/shared_memory.h"
#include "base/task.h"
#include "ipc/ipc_channel.h"
@@ -79,6 +80,7 @@ class ResourceDispatcher {
MessageQueue deferred_message_queue;
bool is_deferred;
GURL url;
+ linked_ptr<IPC::Message> pending_redirect_message;
};
typedef base::hash_map<int, PendingRequestInfo> PendingRequestList;
@@ -86,6 +88,9 @@ class ResourceDispatcher {
// May return NULL if the request as been canceled from the client side.
PendingRequestInfo* GetPendingRequestInfo(int request_id);
+ // Follows redirect, if any, for the given request.
+ void FollowPendingRedirect(int request_id, PendingRequestInfo& request_info);
+
// Message response handlers, called by the message handler for this process.
void OnUploadProgress(
const IPC::Message& message,
diff --git a/chrome/common/service_process_util.h b/chrome/common/service_process_util.h
index 5227dc9..28304e1 100644
--- a/chrome/common/service_process_util.h
+++ b/chrome/common/service_process_util.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/process.h"
+#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
#include "base/task.h"
@@ -97,4 +98,3 @@ class ServiceProcessState {
};
#endif // CHROME_COMMON_SERVICE_PROCESS_UTIL_H_
-
diff --git a/chrome/common/switch_utils.cc b/chrome/common/switch_utils.cc
index d202bcb..b6acf64 100644
--- a/chrome/common/switch_utils.cc
+++ b/chrome/common/switch_utils.cc
@@ -14,6 +14,7 @@ namespace switches {
// pick up an automatic update, be sure to add it to this list.
const char* const kSwitchesToRemoveOnAutorestart[] = {
switches::kApp,
+ switches::kAppId,
switches::kFirstRun,
switches::kImport,
switches::kImportFromFile,
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index 554b5ba..6a1c6a2 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -153,6 +153,7 @@ const char kBlobViewInternalsURL[] = "chrome://blob-internals/";
const char kCloudPrintResourcesURL[] = "chrome://cloudprintresources/";
const char kCloudPrintResourcesHost[] = "cloudprintresources";
+const char kCloudPrintSetupHost[] = "cloudprintsetup";
const char kNetworkViewInternalsURL[] = "chrome://net-internals/";
const char kNetworkViewCacheURL[] = "chrome://view-http-cache/";
@@ -174,7 +175,14 @@ const char kLanguageOptionsSubPage[] = "language";
const char kSystemOptionsSubPage[] = "system";
#endif
-const char kPageInfoHelpCenterURL[] =
+const char kChromeHelpURL[] =
+#if defined(OS_CHROMEOS)
+ "http://www.google.com/support/chromeos/";
+#else
+ "http://www.google.com/support/chrome/";
+#endif
+
+ const char kPageInfoHelpCenterURL[] =
#if defined(OS_CHROMEOS)
"http://www.google.com/support/chromeos/bin/answer.py?answer=95617";
#else
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index 14c2b37..1980b6e 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -148,6 +148,7 @@ extern const char kBlobViewInternalsURL[];
// Cloud Print dialog URL components.
extern const char kCloudPrintResourcesURL[];
extern const char kCloudPrintResourcesHost[];
+extern const char kCloudPrintSetupHost[];
// Network related URLs.
extern const char kNetworkViewCacheURL[];
@@ -170,6 +171,9 @@ extern const char kLanguageOptionsSubPage[];
extern const char kSystemOptionsSubPage[];
#endif
+// General help link for Chrome.
+extern const char kChromeHelpURL[];
+
// "What do these mean?" URL for the Page Info bubble.
extern const char kPageInfoHelpCenterURL[];
diff --git a/chrome/common/web_apps.cc b/chrome/common/web_apps.cc
index cde9690..b9c390c 100644
--- a/chrome/common/web_apps.cc
+++ b/chrome/common/web_apps.cc
@@ -205,7 +205,7 @@ bool ParseWebAppFromWebDocument(WebFrame* frame,
return true;
}
-bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
+bool ParseWebAppFromDefinitionFile(Value* definition_value,
WebApplicationInfo* web_app,
string16* error) {
CHECK(web_app->manifest_url.is_valid());
@@ -230,17 +230,22 @@ bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
// and for forward compat with ourselves.
validator.set_default_allow_additional_properties(true);
- if (!validator.Validate(const_cast<DictionaryValue*>(&definition))) {
+ if (!validator.Validate(definition_value)) {
*error = UTF8ToUTF16(
validator.errors()[0].path + ": " + validator.errors()[0].message);
return false;
}
+ // This must be true because the schema requires the root value to be a
+ // dictionary.
+ CHECK(definition_value->IsType(Value::TYPE_DICTIONARY));
+ DictionaryValue* definition = static_cast<DictionaryValue*>(definition_value);
+
// Parse launch URL. It must be a valid URL in the same origin as the
// manifest.
std::string app_url_string;
GURL app_url;
- CHECK(definition.GetString("launch_url", &app_url_string));
+ CHECK(definition->GetString("launch_url", &app_url_string));
if (!(app_url = web_app->manifest_url.Resolve(app_url_string)).is_valid() ||
app_url.GetOrigin() != web_app->manifest_url.GetOrigin()) {
*error = UTF8ToUTF16(WebApplicationInfo::kInvalidLaunchURL);
@@ -250,7 +255,7 @@ bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
// Parse out the permissions if present.
std::vector<std::string> permissions;
ListValue* permissions_value = NULL;
- if (definition.GetList("permissions", &permissions_value)) {
+ if (definition->GetList("permissions", &permissions_value)) {
for (size_t i = 0; i < permissions_value->GetSize(); ++i) {
std::string permission;
CHECK(permissions_value->GetString(i, &permission));
@@ -261,7 +266,7 @@ bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
// Parse out the URLs if present.
std::vector<GURL> urls;
ListValue* urls_value = NULL;
- if (definition.GetList("urls", &urls_value)) {
+ if (definition->GetList("urls", &urls_value)) {
for (size_t i = 0; i < urls_value->GetSize(); ++i) {
std::string url_string;
GURL url;
@@ -280,7 +285,7 @@ bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
// Parse out the icons if present.
std::vector<WebApplicationInfo::IconInfo> icons;
DictionaryValue* icons_value = NULL;
- if (definition.GetDictionary("icons", &icons_value)) {
+ if (definition->GetDictionary("icons", &icons_value)) {
for (DictionaryValue::key_iterator iter = icons_value->begin_keys();
iter != icons_value->end_keys(); ++iter) {
// Ignore unknown properties. Better for forward compat.
@@ -308,9 +313,9 @@ bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
}
}
- CHECK(definition.GetString("name", &web_app->title));
- definition.GetString("description", &web_app->description);
- definition.GetString("launch_container", &web_app->launch_container);
+ CHECK(definition->GetString("name", &web_app->title));
+ definition->GetString("description", &web_app->description);
+ definition->GetString("launch_container", &web_app->launch_container);
web_app->app_url = app_url;
web_app->urls = urls;
web_app->permissions = permissions;
diff --git a/chrome/common/web_apps.h b/chrome/common/web_apps.h
index 6d40883..91f2023 100644
--- a/chrome/common/web_apps.h
+++ b/chrome/common/web_apps.h
@@ -19,7 +19,7 @@ class WebDocument;
class WebFrame;
}
-class DictionaryValue;
+class Value;
// Structure used when installing a web page as an app.
struct WebApplicationInfo {
@@ -100,7 +100,7 @@ bool ParseWebAppFromWebDocument(WebKit::WebFrame* frame,
// Parses |web_app| information out of |definition|. Returns true on success, or
// false and |error| on failure. This function assumes that |web_app| has a
// valid manifest_url.
-bool ParseWebAppFromDefinitionFile(const DictionaryValue& definition,
+bool ParseWebAppFromDefinitionFile(Value* definition,
WebApplicationInfo* web_app,
string16* error);
diff --git a/chrome/common/web_apps_unittest.cc b/chrome/common/web_apps_unittest.cc
index 3a6980e..fc8b121 100644
--- a/chrome/common/web_apps_unittest.cc
+++ b/chrome/common/web_apps_unittest.cc
@@ -52,7 +52,7 @@ WebApplicationInfo* ParseFromDefinitionAndExpectSuccess(
web_app->manifest_url = GURL("http://example.com/");
string16 error;
- if (!web_apps::ParseWebAppFromDefinitionFile(*defintion, web_app.get(),
+ if (!web_apps::ParseWebAppFromDefinitionFile(defintion.get(), web_app.get(),
&error)) {
ADD_FAILURE() << "Error parsing " << name << ": " << UTF16ToUTF8(error);
return NULL;
@@ -71,7 +71,8 @@ void ParseFromDefinitionAndExpectFailure(const std::string& name,
web_app.manifest_url = GURL("http://example.com/");
string16 error;
- if (web_apps::ParseWebAppFromDefinitionFile(*definition, &web_app, &error)) {
+ if (web_apps::ParseWebAppFromDefinitionFile(definition.get(), &web_app,
+ &error)) {
ADD_FAILURE() << "Expected error parsing " << name
<< " but parse succeeded.";
return;
diff --git a/chrome/common/worker_messages_internal.h b/chrome/common/worker_messages_internal.h
index fed4096..5d0cb62 100644
--- a/chrome/common/worker_messages_internal.h
+++ b/chrome/common/worker_messages_internal.h
@@ -75,6 +75,15 @@ IPC_BEGIN_MESSAGES(WorkerProcessHost)
IPC_MESSAGE_CONTROL2(WorkerProcessHostMsg_SendQueuedMessages,
int /* message_port_id */,
std::vector<QueuedMessage> /* queued_messages */)
+
+ // Sent by the worker process to check whether access to web databases is
+ // granted by content settings.
+ IPC_SYNC_MESSAGE_ROUTED4_1(WorkerProcessHostMsg_AllowDatabase,
+ GURL /* origin url */,
+ string16 /* database name */,
+ string16 /* database display name */,
+ unsigned long /* estimated size */,
+ bool /* result */)
IPC_END_MESSAGES(WorkerProcessHost)
//-----------------------------------------------------------------------------