diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-11 18:19:00 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-11 18:19:00 +0000 |
commit | 5bc8fe91607f20f2d43dc461ca188dd07b55d435 (patch) | |
tree | ca6551f9d816757942485ee7d3542c5aeb4d2fed /chrome/common | |
parent | 3148c0ae4462e01f4b830b8d2150dcd7fee2cb3b (diff) | |
download | chromium_src-5bc8fe91607f20f2d43dc461ca188dd07b55d435.zip chromium_src-5bc8fe91607f20f2d43dc461ca188dd07b55d435.tar.gz chromium_src-5bc8fe91607f20f2d43dc461ca188dd07b55d435.tar.bz2 |
Allow users to close the find session and activate the current link via ctrl-enter.
this only hooks up ctrl-enter on gtk for now, but adding it on windows/mac should be trivial
webkit side, which needs to land first, is here:
https://bugs.webkit.org/show_bug.cgi?id=35407
This also enables the FindInPageControllerTest tests on linux/gtk.
BUG=29500
TEST=FindInPageControllerTest.ActivateLinkNavigatesPage
Review URL: http://codereview.chromium.org/660137
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/render_messages.h | 46 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 7 |
2 files changed, 49 insertions, 4 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index d7c3825..0fb09e4 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -119,6 +119,19 @@ struct ViewMsg_AudioStreamState_Params { State state; }; +// The user has completed a find-in-page; this type defines what actions the +// renderer should take next. +struct ViewMsg_StopFinding_Params { + enum Action { + kClearSelection, + kKeepSelection, + kActivateSelection + }; + + // The action that should be taken when the find is completed. + Action action; +}; + // Parameters structure for ViewHostMsg_FrameNavigate, which has too many data // parameters to be reasonably put in a predefined IPC message. struct ViewHostMsg_FrameNavigate_Params { @@ -1998,6 +2011,39 @@ struct ParamTraits<ViewMsg_AudioStreamState_Params> { }; template <> +struct ParamTraits<ViewMsg_StopFinding_Params> { + typedef ViewMsg_StopFinding_Params param_type; + static void Write(Message* m, const param_type& p) { + m->WriteInt(p.action); + } + static bool Read(const Message* m, void** iter, param_type* p) { + int type; + if (!m->ReadInt(iter, &type)) + return false; + p->action = static_cast<ViewMsg_StopFinding_Params::Action>(type); + return true; + } + static void Log(const param_type& p, std::wstring* l) { + std::wstring action; + switch (p.action) { + case ViewMsg_StopFinding_Params::kClearSelection: + action = L"ViewMsg_StopFinding_Params::kClearSelection"; + break; + case ViewMsg_StopFinding_Params::kKeepSelection: + action = L"ViewMsg_StopFinding_Params::kKeepSelection"; + break; + case ViewMsg_StopFinding_Params::kActivateSelection: + action = L"ViewMsg_StopFinding_Params::kActivateSelection"; + break; + default: + action = L"UNKNOWN"; + break; + } + LogParam(action, l); + } +}; + +template <> struct ParamTraits<ViewMsg_DatabaseOpenFileResponse_Params> { typedef ViewMsg_DatabaseOpenFileResponse_Params param_type; static void Write(Message* m, const param_type& p) { diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 10ca2dc..6f9158a 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -201,10 +201,9 @@ IPC_BEGIN_MESSAGES(View) std::string /* security info */) // This message notifies the renderer that the user has closed the FindInPage - // window (and that the selection should be cleared and the tick-marks - // erased). If |clear_selection| is true, it will also clear the current - // selection. - IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding, bool /* clear_selection */) + // window (and what action to take regarding the selection). + IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding, + ViewMsg_StopFinding_Params /* action */) // These messages are typically generated from context menus and request the // renderer to apply the specified operation to the current selection. |