Commit 8206c7cd authored by aa@chromium.org's avatar aa@chromium.org

Fix race where sometimes CSS is not applied to toolstrips. I

think this was happening because we were injecting from the the
browser at load_start, but the document might not be established
in the renderer by the time this message is received.

Since we are now not even showing the toolstrip until
load_complete, it is no big deal to delay the CSS injection
until then.

Review URL: http://codereview.chromium.org/100182

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14914 0039d316-1c4b-4281-b951-d872f2087c98
parent c100dbdf
...@@ -78,16 +78,17 @@ void ExtensionHost::RunJavaScriptMessage( ...@@ -78,16 +78,17 @@ void ExtensionHost::RunJavaScriptMessage(
render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L""); render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L"");
} }
void ExtensionHost::DidStartLoading(RenderViewHost* render_view_host) { void ExtensionHost::DidStopLoading(RenderViewHost* render_view_host) {
// TODO(aa): This is toolstrip-specific and should probably not be here.
// ExtensionToolstrip in bookmark_bar_view.cc?
static const StringPiece toolstrip_css( static const StringPiece toolstrip_css(
ResourceBundle::GetSharedInstance().GetRawDataResource( ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_EXTENSIONS_TOOLSTRIP_CSS)); IDR_EXTENSIONS_TOOLSTRIP_CSS));
render_view_host->InsertCSSInWebFrame(L"", toolstrip_css.as_string()); render_view_host->InsertCSSInWebFrame(L"", toolstrip_css.as_string());
}
void ExtensionHost::DidStopLoading(RenderViewHost* render_view_host) {
render_view_host->WasResized(); render_view_host->WasResized();
did_stop_loading_ = true; did_stop_loading_ = true;
if (view_) if (view_)
view_->ShowIfCompletelyLoaded(); view_->ShowIfCompletelyLoaded();
} }
......
...@@ -51,7 +51,6 @@ class ExtensionHost : public RenderViewHostDelegate, ...@@ -51,7 +51,6 @@ class ExtensionHost : public RenderViewHostDelegate,
const int flags, const int flags,
IPC::Message* reply_msg, IPC::Message* reply_msg,
bool* did_suppress_message); bool* did_suppress_message);
virtual void DidStartLoading(RenderViewHost* render_view_host);
virtual void DidStopLoading(RenderViewHost* render_view_host); virtual void DidStopLoading(RenderViewHost* render_view_host);
virtual RenderViewHostDelegate::View* GetViewDelegate() const; virtual RenderViewHostDelegate::View* GetViewDelegate() const;
virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher( virtual ExtensionFunctionDispatcher* CreateExtensionFunctionDispatcher(
......
<html> <html>
<link rel="stylesheet" type="text/css" href="extensions_toolstrip.css">
<script> <script>
var dump = function(obj, indent) { var dump = function(obj, indent) {
if (indent === undefined) if (indent === undefined)
......
...@@ -57,7 +57,6 @@ function statusClick() { ...@@ -57,7 +57,6 @@ function statusClick() {
requestStatus(); requestStatus();
</script> </script>
<link rel="stylesheet" type="text/css" href="extensions_toolstrip.css">
<style> <style>
.open { .open {
color: green; color: green;
......
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="extensions_toolstrip.css">
<link rel="stylesheet" type="text/css" href="styles.css"> <link rel="stylesheet" type="text/css" href="styles.css">
<script> <script>
gmail_atom_href = "http://mail.google.com/mail/feed/atom"; gmail_atom_href = "http://mail.google.com/mail/feed/atom";
......
<html> <html>
<link rel="stylesheet" type="text/css" href="extensions_toolstrip.css">
<div id="button" class="toolstrip-button"> <div id="button" class="toolstrip-button">
<img id="icon" src="icon_disabled.png"><span>Subscribe</span> <img id="icon" src="icon_disabled.png"><span>Subscribe</span>
</div> </div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment