summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 17:08:08 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 17:08:08 +0000
commitffaef0ca68c27e10935be966b3660fb5ecd897b8 (patch)
treec2314df36ace91390c20eee91e97796b3287af2e /chrome/browser/renderer_host
parent34021274343928d048f01bc39e7dbbe8481de880 (diff)
downloadchromium_src-ffaef0ca68c27e10935be966b3660fb5ecd897b8.zip
chromium_src-ffaef0ca68c27e10935be966b3660fb5ecd897b8.tar.gz
chromium_src-ffaef0ca68c27e10935be966b3660fb5ecd897b8.tar.bz2
ExtensionShelf now uses the BookmarkExtensionBackground, just like the BookmarkBarView.
Changed the WebKit API to add an optional |id| parameter to the insertStyleText, which is needed to be able to replace style sheets that have been previously added. Added an interface that both BookmarkBarView and ExtensionShelf implement. This new interface tells us whether we are located at the top or at the bottom and whether we are detached from the frame or not. Factored out some of the duplicate painting-related code to a namespace of its own. Not happy with the name (welcome suggestions). Moved the check for whether extensions are on top to new class and now cache the value for the lifetime of the process. Toolstrip text color values are no longer hard-coded but use the color specified in the theme. Decreased the timeouts for showing and hiding the toolstrip handle. Replaced the pressed background image and the hover background image for the toolstrip to match what the bookmark bar uses. Known issues: Some themes expose the fact that: - The background for the extension shelf when in detached mode (and located on the bottom) does not seamlessly blend in with background of new tab page. Still works surprisingly well when it breaks, though. - Didn't spend much time theming the shelf handle (just used the solid color from the theme). - When extension shelf is merged with the bookmark bar, there is a painting artifact (horizontal dotted line) that appears (apparently it was known to appear before this change). BUG=18452, 21272, 21273 TEST=Install a theme for Chrome and make sure everything looks correct and is updated on a theme change. Also make sure painting problems in bugs 21272 and 21273 are fixed. Review URL: http://codereview.chromium.org/204022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc14
-rw-r--r--chrome/browser/renderer_host/render_view_host.h6
2 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index bab8ac8..6d92b81 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -510,8 +510,10 @@ void RenderViewHost::ExecuteJavascriptInWebFrame(
}
void RenderViewHost::InsertCSSInWebFrame(
- const std::wstring& frame_xpath, const std::string& css) {
- Send(new ViewMsg_CSSInsertRequest(routing_id(), frame_xpath, css));
+ const std::wstring& frame_xpath,
+ const std::string& css,
+ const std::string& id) {
+ Send(new ViewMsg_CSSInsertRequest(routing_id(), frame_xpath, css, id));
}
void RenderViewHost::AddMessageToConsole(
@@ -611,7 +613,7 @@ void RenderViewHost::JavaScriptMessageBoxClosed(IPC::Message* reply_msg,
}
void RenderViewHost::JavaScriptMessageBoxWindowDestroyed() {
- ResetModalDialogEvent();
+ ResetModalDialogEvent();
}
void RenderViewHost::ModalHTMLDialogClosed(IPC::Message* reply_msg,
@@ -1111,7 +1113,7 @@ void RenderViewHost::OnMsgFindReply(int request_id,
void RenderViewHost::OnDeterminePageTextReply(
const std::wstring& page_text) {
-#if defined(OS_WIN) // Only for windows.
+#if defined(OS_WIN) // Only for windows.
int num_languages = 0;
bool is_reliable = false;
const char* language_iso_code = LanguageCodeISO639_1(
@@ -1671,8 +1673,8 @@ void RenderViewHost::SignalModalDialogEvent() {
}
void RenderViewHost::ResetModalDialogEvent() {
- if (--modal_dialog_count_ == 0)
- modal_dialog_event_->Reset();
+ if (--modal_dialog_count_ == 0)
+ modal_dialog_event_->Reset();
}
void RenderViewHost::UpdateBrowserWindowId(int window_id) {
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 5be72a4..30f9709 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -258,9 +258,11 @@ class RenderViewHost : public RenderWidgetHost,
void ExecuteJavascriptInWebFrame(const std::wstring& frame_xpath,
const std::wstring& jscript);
- // Insert some css into a frame in the page.
+ // Insert some css into a frame in the page. |id| is optional, and specifies
+ // the element id given when inserting/replacing the style element.
void InsertCSSInWebFrame(const std::wstring& frame_xpath,
- const std::string& css);
+ const std::string& css,
+ const std::string& id);
// Logs a message to the console of a frame in the page.
void AddMessageToConsole(const string16& frame_xpath,