| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/base/event.h" |
| 9 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| 10 | 11 |
| 11 using content::NativeWebKeyboardEvent; | 12 using content::NativeWebKeyboardEvent; |
| 12 using content::WebContents; | 13 using content::WebContents; |
| 13 | 14 |
| 14 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( | 15 NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent( |
| 15 const WebContents* contents, | 16 const WebContents* contents, |
| 16 const views::KeyEvent& key_event) { | 17 const ui::KeyEvent& key_event) { |
| 17 return NativeWebKeyboardEvent(key_event.native_event()); | 18 ui::Event* ui_event = |
| 19 static_cast<ui::Event*>(const_cast<ui::KeyEvent*>(&key_event)); |
| 20 return NativeWebKeyboardEvent(ui_event); |
| 18 } | 21 } |
| 19 | 22 |
| 20 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, | 23 void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos, |
| 21 bool no_redraw) { | 24 bool no_redraw) { |
| 22 if (!host_->IsVisible()) | 25 if (!host_->IsVisible()) |
| 23 host_->GetNativeView()->Show(); | 26 host_->GetNativeView()->Show(); |
| 24 host_->GetNativeView()->SetBounds(new_pos); | 27 host_->GetNativeView()->SetBounds(new_pos); |
| 25 host_->StackAtTop(); | 28 host_->StackAtTop(); |
| 26 } | 29 } |
| OLD | NEW |