summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 17:26:34 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 17:26:34 +0000
commit8c66c5ae2f67738941f4476fd7d5111a89c337ba (patch)
treec18d8c1e0e4f707c51554558466cb74204a1b393 /chrome/renderer
parent1abd61f7cb060fb1e5ccd1546ac1aa157a1801a5 (diff)
downloadchromium_src-8c66c5ae2f67738941f4476fd7d5111a89c337ba.zip
chromium_src-8c66c5ae2f67738941f4476fd7d5111a89c337ba.tar.gz
chromium_src-8c66c5ae2f67738941f4476fd7d5111a89c337ba.tar.bz2
Make scrollbars and other controls tint/untint upon main window gaining
focus on Mac. This entails the following: - getting notifications that the main window has become or lost key window status (in BrowserWindowController) [new] - ... which tells the RenderWidgetHostView(Mac) to (de)activate [new] - ... which tells the RenderWidgetHost to (de)activate [new] - ... which sends a ViewMsg_SetActive message [new message] to the RenderView [new] - ... which tells the WebView(Impl) to (de)activate [new] - ... which tells its page()'s FocusController to (de)activate [new] - ... which is now in WebKit-land. N.B.: "Activate" is the nomenclature used in WebKit; "focus"/"blur" can sometimes (kind of) mean the same thing, but is ambiguous, since "focus" has a more specific meaning. Added a WebView unit test, which currently only tests to make sure that SetActive() (and IsActive() [also new]) work correctly. The changes to the other classes aren't very testable since they don't actually do anything (other than pass things along). BUG=12507 TEST=webkit/glue/webkit_unittest.cc Patch by viettrungluu@gmail.com (see http://codereview.chromium.org/159048 ), r=avi git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc6
-rw-r--r--chrome/renderer/render_view.h5
2 files changed, 10 insertions, 1 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 22671ce..34a415f 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -423,6 +423,7 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_EnableIntrinsicWidthChangedMode,
OnEnableIntrinsicWidthChangedMode)
IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive)
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message))
@@ -2845,6 +2846,11 @@ void RenderView::OnSetBackground(const SkBitmap& background) {
SetBackground(background);
}
+void RenderView::OnSetActive(bool active) {
+ if (webview())
+ webview()->SetActive(active);
+}
+
void RenderView::SendExtensionRequest(const std::string& name,
const std::string& args,
int request_id,
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 9d8705a..7624620 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -380,7 +380,6 @@ class RenderView : public RenderWidget,
// RenderWidget override.
virtual void OnResize(const gfx::Size& new_size,
const gfx::Rect& resizer_rect);
-
// RenderWidget override
virtual void DidPaint();
@@ -587,6 +586,10 @@ class RenderView : public RenderWidget,
// a custom background.
void OnSetBackground(const SkBitmap& background);
+ // Activate/deactivate the RenderView (i.e., set its controls' tint
+ // accordingly, etc.).
+ void OnSetActive(bool active);
+
// Attempt to upload the file that we are trying to process if any.
// Reset the pending file upload data if the form was successfully
// posted.