| 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/omnibox/omnibox_popup_contents_view.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 7 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 9 #include "chrome/browser/ui/views/omnibox/inline_omnibox_popup_view.h" | 9 #include "chrome/browser/ui/views/omnibox/inline_omnibox_popup_view.h" |
| 10 #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" | 10 #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 void OmniboxPopupContentsView::OnMouseEntered( | 352 void OmniboxPopupContentsView::OnMouseEntered( |
| 353 const ui::MouseEvent& event) { | 353 const ui::MouseEvent& event) { |
| 354 model_->SetHoveredLine(GetIndexForPoint(event.location())); | 354 model_->SetHoveredLine(GetIndexForPoint(event.location())); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void OmniboxPopupContentsView::OnMouseExited( | 357 void OmniboxPopupContentsView::OnMouseExited( |
| 358 const ui::MouseEvent& event) { | 358 const ui::MouseEvent& event) { |
| 359 model_->SetHoveredLine(OmniboxPopupModel::kNoMatch); | 359 model_->SetHoveredLine(OmniboxPopupModel::kNoMatch); |
| 360 } | 360 } |
| 361 | 361 |
| 362 ui::GestureStatus OmniboxPopupContentsView::OnGestureEvent( | 362 ui::EventResult OmniboxPopupContentsView::OnGestureEvent( |
| 363 const ui::GestureEvent& event) { | 363 const ui::GestureEvent& event) { |
| 364 switch (event.type()) { | 364 switch (event.type()) { |
| 365 case ui::ET_GESTURE_TAP_DOWN: | 365 case ui::ET_GESTURE_TAP_DOWN: |
| 366 case ui::ET_GESTURE_SCROLL_BEGIN: | 366 case ui::ET_GESTURE_SCROLL_BEGIN: |
| 367 case ui::ET_GESTURE_SCROLL_UPDATE: | 367 case ui::ET_GESTURE_SCROLL_UPDATE: |
| 368 UpdateLineEvent(event, true); | 368 UpdateLineEvent(event, true); |
| 369 break; | 369 break; |
| 370 case ui::ET_GESTURE_TAP: | 370 case ui::ET_GESTURE_TAP: |
| 371 case ui::ET_GESTURE_SCROLL_END: | 371 case ui::ET_GESTURE_SCROLL_END: |
| 372 OpenSelectedLine(event, CURRENT_TAB); | 372 OpenSelectedLine(event, CURRENT_TAB); |
| 373 break; | 373 break; |
| 374 default: | 374 default: |
| 375 return ui::GESTURE_STATUS_UNKNOWN; | 375 return ui::ER_UNHANDLED; |
| 376 } | 376 } |
| 377 return ui::GESTURE_STATUS_CONSUMED; | 377 return ui::ER_CONSUMED; |
| 378 } | 378 } |
| 379 | 379 |
| 380 //////////////////////////////////////////////////////////////////////////////// | 380 //////////////////////////////////////////////////////////////////////////////// |
| 381 // OmniboxPopupContentsView, protected: | 381 // OmniboxPopupContentsView, protected: |
| 382 | 382 |
| 383 void OmniboxPopupContentsView::PaintResultViews(gfx::Canvas* canvas) { | 383 void OmniboxPopupContentsView::PaintResultViews(gfx::Canvas* canvas) { |
| 384 canvas->DrawColor(OmniboxResultView::GetColor( | 384 canvas->DrawColor(OmniboxResultView::GetColor( |
| 385 OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND)); | 385 OmniboxResultView::NORMAL, OmniboxResultView::BACKGROUND)); |
| 386 View::PaintChildren(canvas); | 386 View::PaintChildren(canvas); |
| 387 } | 387 } |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 if (HasMatchAt(index) && should_set_selected_line) | 549 if (HasMatchAt(index) && should_set_selected_line) |
| 550 model_->SetSelectedLine(index, false, false); | 550 model_->SetSelectedLine(index, false, false); |
| 551 } | 551 } |
| 552 | 552 |
| 553 void OmniboxPopupContentsView::OpenSelectedLine( | 553 void OmniboxPopupContentsView::OpenSelectedLine( |
| 554 const ui::LocatedEvent& event, | 554 const ui::LocatedEvent& event, |
| 555 WindowOpenDisposition disposition) { | 555 WindowOpenDisposition disposition) { |
| 556 size_t index = GetIndexForPoint(event.location()); | 556 size_t index = GetIndexForPoint(event.location()); |
| 557 OpenIndex(index, disposition); | 557 OpenIndex(index, disposition); |
| 558 } | 558 } |
| OLD | NEW |