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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 7 years, 3 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) 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/omnibox/omnibox_popup_contents_view.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
6 6
7 #include "chrome/browser/search/search.h" 7 #include "chrome/browser/search/search.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/ui/omnibox/omnibox_view.h" 9 #include "chrome/browser/ui/omnibox/omnibox_view.h"
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 void OmniboxPopupContentsView::Layout() { 306 void OmniboxPopupContentsView::Layout() {
307 // Size our children to the available content area. 307 // Size our children to the available content area.
308 LayoutChildren(); 308 LayoutChildren();
309 309
310 // We need to manually schedule a paint here since we are a layered window and 310 // We need to manually schedule a paint here since we are a layered window and
311 // won't implicitly require painting until we ask for one. 311 // won't implicitly require painting until we ask for one.
312 SchedulePaint(); 312 SchedulePaint();
313 } 313 }
314 314
315 views::View* OmniboxPopupContentsView::GetEventHandlerForPoint( 315 views::View* OmniboxPopupContentsView::GetEventHandlerForRect(
316 const gfx::Point& point) { 316 const gfx::Rect& rect) {
317 return this; 317 return this;
318 } 318 }
319 319
320 views::View* OmniboxPopupContentsView::GetTooltipHandlerForPoint( 320 views::View* OmniboxPopupContentsView::GetTooltipHandlerForPoint(
321 const gfx::Point& point) { 321 const gfx::Point& point) {
322 return NULL; 322 return NULL;
323 } 323 }
324 324
325 bool OmniboxPopupContentsView::OnMousePressed( 325 bool OmniboxPopupContentsView::OnMousePressed(
326 const ui::MouseEvent& event) { 326 const ui::MouseEvent& event) {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 // OpenMatch() may close the popup, which will clear the result set and, by 519 // OpenMatch() may close the popup, which will clear the result set and, by
520 // extension, |match| and its contents. So copy the relevant match out to 520 // extension, |match| and its contents. So copy the relevant match out to
521 // make sure it stays alive until the call completes. 521 // make sure it stays alive until the call completes.
522 AutocompleteMatch match = model_->result().match_at(index); 522 AutocompleteMatch match = model_->result().match_at(index);
523 omnibox_view_->OpenMatch(match, disposition, GURL(), index); 523 omnibox_view_->OpenMatch(match, disposition, GURL(), index);
524 } 524 }
525 525
526 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { 526 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) {
527 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); 527 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i)));
528 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698