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

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

Issue 7285005: Make Windows FindBar stay within window bounds for narrow windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/views/dropdown_bar_host.h" 5 #include "chrome/browser/ui/views/dropdown_bar_host.h"
6 6
7 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 7 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
8 #include "chrome/browser/ui/views/frame/browser_view.h" 8 #include "chrome/browser/ui/views/frame/browser_view.h"
9 #include "content/browser/renderer_host/render_view_host.h" 9 #include "content/browser/renderer_host/render_view_host.h"
10 #include "content/browser/tab_contents/tab_contents.h" 10 #include "content/browser/tab_contents/tab_contents.h"
11 #include "content/browser/tab_contents/tab_contents_view.h" 11 #include "content/browser/tab_contents/tab_contents_view.h"
12 #include "ui/base/keycodes/keyboard_code_conversion_win.h" 12 #include "ui/base/keycodes/keyboard_code_conversion_win.h"
13 #include "views/controls/scrollbar/native_scroll_bar.h" 13 #include "views/controls/scrollbar/native_scroll_bar.h"
14 14
15 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( 15 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent(
16 const TabContents* contents, 16 const TabContents* contents,
17 const views::KeyEvent& key_event) { 17 const views::KeyEvent& key_event) {
18 HWND hwnd = contents->GetContentNativeView(); 18 HWND hwnd = contents->GetContentNativeView();
19 WORD key = WindowsKeyCodeForKeyboardCode(key_event.key_code()); 19 WORD key = WindowsKeyCodeForKeyboardCode(key_event.key_code());
20 20
21 return NativeWebKeyboardEvent(hwnd, key_event.native_event().message, key, 0); 21 return NativeWebKeyboardEvent(hwnd, key_event.native_event().message, key, 0);
22 } 22 }
23 23
24 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, 24 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos,
25 bool no_redraw) { 25 bool no_redraw) {
26 gfx::Rect window_rect = host_->GetWindowScreenBounds(); 26 gfx::Rect window_rect = host_->GetWindowScreenBounds();
Finnur 2011/06/30 22:10:24 This is redundant now...
jennb 2011/06/30 22:26:47 Done.
27 DWORD swp_flags = SWP_NOOWNERZORDER; 27 DWORD swp_flags = SWP_NOOWNERZORDER;
28 if (!window_rect.IsEmpty())
29 swp_flags |= SWP_NOSIZE;
Finnur 2011/06/30 22:10:24 why is this necessary?
jennb 2011/06/30 22:26:47 DropdownBarView::PaintOffsetToolbarBackground was
30 if (no_redraw) 28 if (no_redraw)
31 swp_flags |= SWP_NOREDRAW; 29 swp_flags |= SWP_NOREDRAW;
32 if (!host_->IsVisible()) 30 if (!host_->IsVisible())
33 swp_flags |= SWP_SHOWWINDOW; 31 swp_flags |= SWP_SHOWWINDOW;
34 32
35 ::SetWindowPos(host_->GetNativeView(), HWND_TOP, new_pos.x(), new_pos.y(), 33 ::SetWindowPos(host_->GetNativeView(), HWND_TOP, new_pos.x(), new_pos.y(),
36 new_pos.width(), new_pos.height(), swp_flags); 34 new_pos.width(), new_pos.height(), swp_flags);
37 } 35 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/find_bar_host.cc » ('j') | chrome/browser/ui/views/find_bar_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698