summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/find_bar_view.cc
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 23:48:30 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 23:48:30 +0000
commit5c9e97acabd4cdab5adb20d2412a5766b3382856 (patch)
treeead11654548e0e110cf8c8dce962801d530d54f7 /chrome/browser/views/find_bar_view.cc
parent7f01f83fd464fc13cbdb9d377493d1781decf363 (diff)
downloadchromium_src-5c9e97acabd4cdab5adb20d2412a5766b3382856.zip
chromium_src-5c9e97acabd4cdab5adb20d2412a5766b3382856.tar.gz
chromium_src-5c9e97acabd4cdab5adb20d2412a5766b3382856.tar.bz2
First cut at implementation of FindBar for views / gtk
Also had to implement change notification for TextField on views / gtk Review URL: http://codereview.chromium.org/200035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_view.cc')
-rw-r--r--chrome/browser/views/find_bar_view.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc
index 857869c..bd7e0bb 100644
--- a/chrome/browser/views/find_bar_view.cc
+++ b/chrome/browser/views/find_bar_view.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/browser/views/find_bar_win.h"
+#include "chrome/browser/views/find_bar_host.h"
#include "chrome/browser/view_ids.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
@@ -76,7 +76,7 @@ static const int kDefaultCharWidth = 43;
////////////////////////////////////////////////////////////////////////////////
// FindBarView, public:
-FindBarView::FindBarView(FindBarWin* container)
+FindBarView::FindBarView(FindBarHost* container)
: container_(container),
find_text_(NULL),
match_count_text_(NULL),
@@ -467,24 +467,20 @@ bool FindBarView::HandleKeystroke(views::Textfield* sender,
if (!container_->IsVisible())
return false;
- // TODO(port): Handle this for other platforms.
- #if defined(OS_WIN)
- if (container_->MaybeForwardKeystrokeToWebpage(key.message, key.key,
- key.flags))
+ if (container_->MaybeForwardKeystrokeToWebpage(key))
return true; // Handled, we are done!
- if (views::Textfield::IsKeystrokeEnter(key)) {
+ if (key.GetKeyboardCode() == base::VKEY_RETURN) {
// Pressing Return/Enter starts the search (unless text box is empty).
- std::wstring find_string = find_text_->text();
+ string16 find_string = find_text_->text();
if (!find_string.empty()) {
// Search forwards for enter, backwards for shift-enter.
container_->GetFindBarController()->tab_contents()->StartFinding(
find_string,
- GetKeyState(VK_SHIFT) >= 0,
+ key.IsShiftHeld(),
false); // Not case sensitive.
}
}
- #endif
return false;
}