#include "ui/gfx/image/image.h"
#include "ui/gfx/path.h"
#include "ui/views/controls/image_view.h"
+#include "ui/views/view_targeter.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
#include "ui/wm/core/window_animations.h"
ui::ThemeProvider* theme = location_bar_view_->GetThemeProvider();
bottom_shadow_ = theme->GetImageSkiaNamed(IDR_BUBBLE_B);
+
+ SetEventTargeter(
+ scoped_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
}
void OmniboxPopupContentsView::Init() {
target_bounds_ = new_target_bounds;
if (popup_ == NULL) {
- gfx::NativeView popup_parent =
- location_bar_view_->GetWidget()->GetNativeView();
+ views::Widget* popup_parent = location_bar_view_->GetWidget();
// If the popup is currently closed, we need to create it.
popup_ = (new AutocompletePopupWidget)->AsWeakPtr();
views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
- params.parent = popup_parent;
+ params.parent = popup_parent->GetNativeView();
params.bounds = GetPopupBounds();
- params.context = popup_parent;
+ params.context = popup_parent->GetNativeWindow();
popup_->Init(params);
// Third-party software such as DigitalPersona identity verification can
// hook the underlying window creation methods and use SendMessage to
return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index));
}
+bool OmniboxPopupContentsView::IsStarredMatch(
+ const AutocompleteMatch& match) const {
+ return model_->IsStarredMatch(match);
+}
+
////////////////////////////////////////////////////////////////////////////////
// OmniboxPopupContentsView, AnimationDelegate implementation:
SchedulePaint();
}
-views::View* OmniboxPopupContentsView::GetEventHandlerForRect(
- const gfx::Rect& rect) {
- return this;
-}
-
views::View* OmniboxPopupContentsView::GetTooltipHandlerForPoint(
const gfx::Point& point) {
return NULL;
////////////////////////////////////////////////////////////////////////////////
// OmniboxPopupContentsView, private:
+views::View* OmniboxPopupContentsView::TargetForRect(views::View* root,
+ const gfx::Rect& rect) {
+ CHECK_EQ(root, this);
+ return this;
+}
+
bool OmniboxPopupContentsView::HasMatchAt(size_t index) const {
return index < model_->result().size();
}