summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 17:53:05 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 17:53:05 +0000
commit64268ce6b86e7f46dba3313c93e823e544528666 (patch)
tree96e61ee1f91a3f8f33fa1c9d180ed16ea6ecc726
parent15eaf50cd1ee763193d8cbe33e5f0d823d295d12 (diff)
downloadchromium_src-64268ce6b86e7f46dba3313c93e823e544528666.zip
chromium_src-64268ce6b86e7f46dba3313c93e823e544528666.tar.gz
chromium_src-64268ce6b86e7f46dba3313c93e823e544528666.tar.bz2
Fix missing throbber in sync dialogs. This actually does a number of things:
* Correct throbber path in choose_datatypes.html (I overlooked this) * Change CSS style settings for throbber to a form the inliner could understand, so the image got inlined properly * Remove references to throbber path from sync_setup_wizard.cc (no longer needed) * Fix improper use of url_constants.* (only paths that need to be in common/ should be there) and change sync hostname constant name to match other hostnames' naming scheme BUG=40984 TEST=Signing into GAIA in sync setup dialog should show a throbber Review URL: http://codereview.chromium.org/2840035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52501 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/dom_ui/dom_ui_factory.cc2
-rw-r--r--chrome/browser/sync/resources/choose_datatypes.html12
-rw-r--r--chrome/browser/sync/resources/gaia_login.html11
-rw-r--r--chrome/browser/sync/sync_setup_wizard.cc30
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc2
-rw-r--r--chrome/common/url_constants.cc8
-rw-r--r--chrome/common/url_constants.h9
7 files changed, 33 insertions, 41 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc
index 9ff2137..41ac7348 100644
--- a/chrome/browser/dom_ui/dom_ui_factory.cc
+++ b/chrome/browser/dom_ui/dom_ui_factory.cc
@@ -85,7 +85,7 @@ static DOMUIFactoryFunction GetDOMUIFactoryFunction(const GURL& url) {
!url.SchemeIs(chrome::kChromeUIScheme))
return NULL;
- if (url.host() == chrome::kSyncResourcesHost)
+ if (url.host() == chrome::kChromeUISyncResourcesHost)
return &NewDOMUI<HtmlDialogUI>;
// Special case the new tab page. In older versions of Chrome, the new tab
diff --git a/chrome/browser/sync/resources/choose_datatypes.html b/chrome/browser/sync/resources/choose_datatypes.html
index 6b40492..bc01f5e 100644
--- a/chrome/browser/sync/resources/choose_datatypes.html
+++ b/chrome/browser/sync/resources/choose_datatypes.html
@@ -42,6 +42,14 @@ table {
.data_type_checkboxes_table td {
padding: 5px;
}
+#throb {
+ background-image: url("../../../../app/resources/throbber.png");
+ width: 16px;
+ height: 16px;
+ background-position: 0px;
+ margin: -3px 10px;
+ display: inline-block;
+}
input[type='button'] {
min-width: 87px;
min-height: 26px;
@@ -260,9 +268,7 @@ input[type='submit'] {
<tr valign="bottom">
<td width="100%" class="endaligned">
<span id="throbber_container" style="visibility:hidden">
- <span id="throb" style="background-image:url(throbber.png);
- width:16px; height:16px; background-position:0px; margin:-3px 10px;
- display:inline-block">
+ <span id="throb">
</span>
</span>
<input id="okButton" type="submit" i18n-values="value:ok" />
diff --git a/chrome/browser/sync/resources/gaia_login.html b/chrome/browser/sync/resources/gaia_login.html
index 9f55bd1..6ada2a5 100644
--- a/chrome/browser/sync/resources/gaia_login.html
+++ b/chrome/browser/sync/resources/gaia_login.html
@@ -52,6 +52,13 @@
width: 200px;
height: 70px;
}
+ #throb {
+ background-image: url("../../../../app/resources/throbber.png");
+ width: 16px;
+ height: 16px;
+ background-position: 0px;
+ margin: 0px 10px 0px 10px"
+ }
.toppageverticalspace {
height: 15px;
}
@@ -438,9 +445,7 @@
<tr>
<td>
<div id="throbber_container" style="display:none;">
- <div id="throb" style="background-image:url(../../../../app/resources/throbber.png);
- width:16px; height:16px; background-position:0px;
- margin:0px 10px 0px 10px">
+ <div id="throb">
</div>
</div>
</td>
diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc
index 47b5883..0329a4a 100644
--- a/chrome/browser/sync/sync_setup_wizard.cc
+++ b/chrome/browser/sync/sync_setup_wizard.cc
@@ -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.
@@ -25,7 +25,7 @@
class SyncResourcesSource : public ChromeURLDataManager::DataSource {
public:
SyncResourcesSource()
- : DataSource(chrome::kSyncResourcesHost, MessageLoop::current()) {
+ : DataSource(chrome::kChromeUISyncResourcesHost, MessageLoop::current()) {
}
virtual void StartDataRequest(const std::string& path,
@@ -33,10 +33,7 @@ class SyncResourcesSource : public ChromeURLDataManager::DataSource {
int request_id);
virtual std::string GetMimeType(const std::string& path) const {
- if (path == chrome::kSyncThrobberPath)
- return "image/png";
- else
- return "text/html";
+ return "text/html";
}
static const char* kInvalidPasswordHelpUrl;
@@ -63,17 +60,13 @@ const char* SyncResourcesSource::kCreateNewAccountUrl =
void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
bool is_off_the_record, int request_id) {
- scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes);
- if (path_raw == chrome::kSyncThrobberPath) {
- scoped_refptr<RefCountedMemory> throbber(
- ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_THROBBER));
- SendResponse(request_id, throbber);
- return;
- }
+ const char kSyncGaiaLoginPath[] = "gaialogin";
+ const char kSyncChooseDataTypesPath[] = "choosedatatypes";
+ const char kSyncSetupFlowPath[] = "setup";
+ const char kSyncSetupDonePath[] = "setupdone";
std::string response;
- if (path_raw == chrome::kSyncGaiaLoginPath) {
+ if (path_raw == kSyncGaiaLoginPath) {
DictionaryValue localized_strings;
// Start by setting the per-locale URLs we show on the setup wizard.
@@ -124,7 +117,7 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
SetFontAndTextDirection(&localized_strings);
response = jstemplate_builder::GetI18nTemplateHtml(
html, &localized_strings);
- } else if (path_raw == chrome::kSyncChooseDataTypesPath) {
+ } else if (path_raw == kSyncChooseDataTypesPath) {
DictionaryValue localized_strings;
localized_strings.SetString(L"choosedatatypesheader",
l10n_util::GetString(IDS_SYNC_CHOOSE_DATATYPES_HEADER));
@@ -162,7 +155,7 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
SetFontAndTextDirection(&localized_strings);
response = jstemplate_builder::GetI18nTemplateHtml(
html, &localized_strings);
- } else if (path_raw == chrome::kSyncSetupDonePath) {
+ } else if (path_raw == kSyncSetupDonePath) {
DictionaryValue localized_strings;
localized_strings.SetString(L"success",
l10n_util::GetString(IDS_SYNC_SUCCESS));
@@ -178,12 +171,13 @@ void SyncResourcesSource::StartDataRequest(const std::string& path_raw,
SetFontAndTextDirection(&localized_strings);
response = jstemplate_builder::GetI18nTemplateHtml(
html, &localized_strings);
- } else if (path_raw == chrome::kSyncSetupFlowPath) {
+ } else if (path_raw == kSyncSetupFlowPath) {
static const base::StringPiece html(ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_SYNC_SETUP_FLOW_HTML));
response = html.as_string();
}
// Send the response.
+ scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes);
html_bytes->data.resize(response.size());
std::copy(response.begin(), response.end(), html_bytes->data.begin());
SendResponse(request_id, html_bytes);
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 7bb1c5c9..37e2e01 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -62,7 +62,7 @@ bool RenderViewContextMenu::IsDevToolsURL(const GURL& url) {
// static
bool RenderViewContextMenu::IsSyncResourcesURL(const GURL& url) {
return url.SchemeIs(chrome::kChromeUIScheme) &&
- url.host() == chrome::kSyncResourcesHost;
+ url.host() == chrome::kChromeUISyncResourcesHost;
}
static const int kSpellcheckRadioGroup = 1;
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index ec85309..9504325 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -98,16 +98,10 @@ const char kChromeUIPrintHost[] = "print";
const char kChromeUIRemotingHost[] = "remoting";
const char kChromeUIResourcesHost[] = "resources";
const char kChromeUISlideshowHost[] = "slideshow";
+const char kChromeUISyncResourcesHost[] = "syncresources";
const char kChromeUIThemePath[] = "theme";
const char kChromeUIThumbnailPath[] = "thumb";
-const char kSyncResourcesHost[] = "syncresources";
-const char kSyncGaiaLoginPath[] = "gaialogin";
-const char kSyncChooseDataTypesPath[] = "choosedatatypes";
-const char kSyncThrobberPath[] = "throbber.png";
-const char kSyncSetupFlowPath[] = "setup";
-const char kSyncSetupDonePath[] = "setupdone";
-
const char kAppCacheViewInternalsURL[] = "chrome://appcache-internals/";
const char kCloudPrintResourcesURL[] = "chrome://cloudprintresources/";
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index 24cd3b0..9f53097 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -92,17 +92,10 @@ extern const char kChromeUIPrintHost[];
extern const char kChromeUIRemotingHost[];
extern const char kChromeUIResourcesHost[];
extern const char kChromeUISlideshowHost[];
+extern const char kChromeUISyncResourcesHost[];
extern const char kChromeUIThumbnailPath[];
extern const char kChromeUIThemePath[];
-// Sync related URL components.
-extern const char kSyncResourcesHost[];
-extern const char kSyncGaiaLoginPath[];
-extern const char kSyncChooseDataTypesPath[];
-extern const char kSyncSetupDonePath[];
-extern const char kSyncSetupFlowPath[];
-extern const char kSyncThrobberPath[];
-
// AppCache related URL.
extern const char kAppCacheViewInternalsURL[];