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

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

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "chrome/browser/ui/views/frame/browser_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h"
10 #include "content/browser/tab_contents/tab_contents.h" 10 #include "content/browser/tab_contents/tab_contents.h"
11 #include "views/widget/widget.h" 11 #include "views/widget/widget.h"
12 #include "views/controls/textfield/textfield.h" 12 #include "views/controls/textfield/textfield.h"
13 13
14 #if defined(TOUCH_UI) 14 #if defined(TOUCH_UI)
15 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" 15 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
16 #endif 16 #endif
17 17
18 views::Widget* DropdownBarHost::CreateHost() {
19 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_CONTROL);
20 // We own the host.
21 params.delete_on_destroy = false;
22 return views::Widget::CreateWidget(params);
23 }
24
25 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, 18 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos,
26 bool no_redraw) { 19 bool no_redraw) {
27 host_->SetBounds(new_pos); 20 host_->SetBounds(new_pos);
28 host_->Show(); 21 host_->Show();
29 } 22 }
30 23
31 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( 24 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent(
32 const TabContents* contents, 25 const TabContents* contents,
33 const views::KeyEvent& key_event) { 26 const views::KeyEvent& key_event) {
34 #if defined(TOUCH_UI) 27 #if defined(TOUCH_UI)
(...skipping 18 matching lines...) Expand all
53 // https://bugzilla.gnome.org/show_bug.cgi?id=644836 gets sorted out. 46 // https://bugzilla.gnome.org/show_bug.cgi?id=644836 gets sorted out.
54 if (key_event.key_code() == ui::VKEY_RETURN) { 47 if (key_event.key_code() == ui::VKEY_RETURN) {
55 wke.text[0] = wke.unmodifiedText[0] = '\r'; 48 wke.text[0] = wke.unmodifiedText[0] = '\r';
56 } 49 }
57 50
58 return wke; 51 return wke;
59 #else 52 #else
60 return NativeWebKeyboardEvent(&key_event.native_event()->key); 53 return NativeWebKeyboardEvent(&key_event.native_event()->key);
61 #endif 54 #endif
62 } 55 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.cc ('k') | chrome/browser/ui/views/dropdown_bar_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698