This source file includes following definitions.
- GetKeyboardEvent
- SetWidgetPositionNative
- SetHostViewNative
#include "chrome/browser/ui/views/dropdown_bar_host.h"
#include "base/logging.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
#include "ui/views/view_constants_aura.h"
#include "ui/views/widget/widget.h"
using content::NativeWebKeyboardEvent;
using content::WebContents;
NativeWebKeyboardEvent DropdownBarHost::GetKeyboardEvent(
const WebContents* contents,
const ui::KeyEvent& key_event) {
ui::Event* ui_event =
static_cast<ui::Event*>(const_cast<ui::KeyEvent*>(&key_event));
return NativeWebKeyboardEvent(ui_event);
}
void DropdownBarHost::SetWidgetPositionNative(const gfx::Rect& new_pos,
bool no_redraw) {
if (!host_->IsVisible())
host_->GetNativeView()->Show();
host_->GetNativeView()->SetBounds(new_pos);
}
void DropdownBarHost::SetHostViewNative(views::View* host_view) {
host_->GetNativeView()->SetProperty(views::kHostViewKey, host_view);
}