Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/browser/ui/views/find_bar_host_win.cc

Issue 6034002: Replace Textfield::Keystroke with views::KeyEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: key_code, ET_KEY_PRESS for WM_CHAR Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/find_bar_host_gtk.cc ('k') | chrome/browser/ui/views/find_bar_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/find_bar_host.h" 5 #include "chrome/browser/views/find_bar_host.h"
6 6
7 #include "chrome/browser/renderer_host/render_view_host.h" 7 #include "chrome/browser/renderer_host/render_view_host.h"
8 #include "chrome/browser/tab_contents/tab_contents.h" 8 #include "chrome/browser/tab_contents/tab_contents.h"
9 #include "chrome/browser/tab_contents/tab_contents_view.h" 9 #include "chrome/browser/tab_contents/tab_contents_view.h"
10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 10 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
11 #include "chrome/browser/views/frame/browser_view.h" 11 #include "chrome/browser/views/frame/browser_view.h"
12 #include "views/controls/scrollbar/native_scroll_bar.h" 12 #include "views/controls/scrollbar/native_scroll_bar.h"
13 #include "views/widget/widget_win.h" 13 #include "views/widget/widget_win.h"
14 14
15 void FindBarHost::AudibleAlert() { 15 void FindBarHost::AudibleAlert() {
16 MessageBeep(MB_OK); 16 MessageBeep(MB_OK);
17 } 17 }
18 18
19 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) { 19 void FindBarHost::GetWidgetPositionNative(gfx::Rect* avoid_overlapping_rect) {
20 RECT frame_rect = {0}, webcontents_rect = {0}; 20 RECT frame_rect = {0}, webcontents_rect = {0};
21 ::GetWindowRect( 21 ::GetWindowRect(
22 static_cast<views::WidgetWin*>(host())->GetParent(), &frame_rect); 22 static_cast<views::WidgetWin*>(host())->GetParent(), &frame_rect);
23 ::GetWindowRect( 23 ::GetWindowRect(
24 find_bar_controller_->tab_contents()->view()->GetNativeView(), 24 find_bar_controller_->tab_contents()->view()->GetNativeView(),
25 &webcontents_rect); 25 &webcontents_rect);
26 avoid_overlapping_rect->Offset(0, webcontents_rect.top - frame_rect.top); 26 avoid_overlapping_rect->Offset(0, webcontents_rect.top - frame_rect.top);
27 } 27 }
28 28
29 bool FindBarHost::ShouldForwardKeystrokeToWebpageNative( 29 bool FindBarHost::ShouldForwardKeyEventToWebpageNative(
30 const views::Textfield::Keystroke& key_stroke) { 30 const views::KeyEvent& key_event) {
31 // We specifically ignore WM_CHAR. See http://crbug.com/10509. 31 // We specifically ignore WM_CHAR. See http://crbug.com/10509.
32 return key_stroke.message() == WM_KEYDOWN || key_stroke.message() == WM_KEYUP; 32 return key_event.message() == WM_KEYDOWN || key_event.message() == WM_KEYUP;
33 } 33 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_host_gtk.cc ('k') | chrome/browser/ui/views/find_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698