diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/generated_resources.grd | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_ui.cc | 6 | ||||
-rw-r--r-- | chrome/browser/resources/extensions_ui.html | 33 |
3 files changed, 34 insertions, 7 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 174b202..10844c9 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -2679,7 +2679,7 @@ each locale. --> <message name="IDS_EXTENSIONS_OPTIONS" desc="The button text for the options button."> Options </message> - <message name="IDS_GET_MORE_EXTENSIONS" desc="The link for getting more extensions."> + <message name="IDS_GET_MORE_EXTENSIONS" desc="The link for getting more extensions. Displayed at bottom of extension management page when there is at least one extension installed."> Get more extensions >> </message> <message name="IDS_EXTENSION_LOAD_FROM_DIRECTORY" desc="Title of directory browse dialog when user wants to load an extension from a directory."> diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc index 7f66418..c8bcc06 100644 --- a/chrome/browser/extensions/extensions_ui.cc +++ b/chrome/browser/extensions/extensions_ui.cc @@ -76,6 +76,12 @@ void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path, ASCIIToWide(Extension::kGalleryBrowseUrl) + L"'>", L"</a>")); + localized_strings.SetString(L"getMoreExtensions", + std::wstring(L"<a href='") + + ASCIIToWide(Extension::kGalleryBrowseUrl) + + L"'>" + + l10n_util::GetString(IDS_GET_MORE_EXTENSIONS) + + L"</a>"); localized_strings.SetString(L"extensionDisabled", l10n_util::GetString(IDS_EXTENSIONS_DISABLED_EXTENSION)); localized_strings.SetString(L"inDevelopment", diff --git a/chrome/browser/resources/extensions_ui.html b/chrome/browser/resources/extensions_ui.html index 66eb521..62f1ab8 100644 --- a/chrome/browser/resources/extensions_ui.html +++ b/chrome/browser/resources/extensions_ui.html @@ -150,6 +150,12 @@ body.showDevMode .showInDevMode { font-weight :normal; } +#get-moar-extensions { + margin-top: 1em; + text-align: right; + font-weight: bold; +} + .extension-description { margin-top: 0.4em; } @@ -370,12 +376,6 @@ function renderTemplate(extensionsData) { var input = new JsEvalContext(extensionsData); var output = document.getElementById('extensionTemplate'); jstProcess(input, output); - - // Blech, JSTemplate always inserts the strings as text, which is usually a - // feature, but in this case it contains HTML that we want to be rendered. - var elm = document.getElementById("try-gallery"); - if (elm) - elm.innerHTML = elm.textContent; } /** @@ -391,6 +391,9 @@ function requestExtensionsData() { // tests. var domui_responded_ = false; +// Used to only do some work the first time we render. +var rendered_once_ = false; + /** * Called by the dom_ui_ to re-populate the page with data representing * the current state of installed extensions. @@ -425,6 +428,21 @@ function returnExtensionsData(extensionsData){ bodyContainer.style.visibility = "visible"; body.className = devModeExpanded ? "showDevModeInitial" : "hideDevModeInitial"; + + if (rendered_once_) + return; + + // Blech, JSTemplate always inserts the strings as text, which is usually a + // feature, but in this case it contains HTML that we want to be rendered. + var elm = document.getElementById("try-gallery"); + if (elm) + elm.innerHTML = elm.textContent; + + elm = document.getElementById("get-moar-extensions"); + if (elm) + elm.innerHTML = elm.textContent; + + rendered_once_ = true; } /** @@ -763,6 +781,9 @@ function autoUpdate() { </table> </div> </div> + + <div id="get-moar-extensions" jsdisplay="extensions.length > 0" + i18n-content="getMoreExtensions"></div> </div> </div> </div> |