| 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/inline_omnibox_popup_view.h" | 5 #include "chrome/browser/ui/views/omnibox/inline_omnibox_popup_view.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 10 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 gfx::Size InlineOmniboxPopupView::GetPreferredSize() { | 237 gfx::Size InlineOmniboxPopupView::GetPreferredSize() { |
| 238 return GetPopupBounds().size(); | 238 return GetPopupBounds().size(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void InlineOmniboxPopupView::Layout() { | 241 void InlineOmniboxPopupView::Layout() { |
| 242 // Size our children to the available content area. | 242 // Size our children to the available content area. |
| 243 LayoutChildren(); | 243 LayoutChildren(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 views::View* InlineOmniboxPopupView::GetEventHandlerForPoint( | 246 views::View* InlineOmniboxPopupView::GetEventHandler(const gfx::Rect& rect, |
| 247 const gfx::Point& point) { | 247 EventType type) { |
| 248 return this; | 248 return this; |
| 249 } | 249 } |
| 250 | 250 |
| 251 bool InlineOmniboxPopupView::OnMousePressed( | 251 bool InlineOmniboxPopupView::OnMousePressed( |
| 252 const ui::MouseEvent& event) { | 252 const ui::MouseEvent& event) { |
| 253 ignore_mouse_drag_ = false; // See comment on |ignore_mouse_drag_| in header. | 253 ignore_mouse_drag_ = false; // See comment on |ignore_mouse_drag_| in header. |
| 254 if (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) | 254 if (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) |
| 255 UpdateLineEvent(event, event.IsLeftMouseButton()); | 255 UpdateLineEvent(event, event.IsLeftMouseButton()); |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 if (HasMatchAt(index) && should_set_selected_line) | 397 if (HasMatchAt(index) && should_set_selected_line) |
| 398 model_->SetSelectedLine(index, false, false); | 398 model_->SetSelectedLine(index, false, false); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void InlineOmniboxPopupView::OpenSelectedLine( | 401 void InlineOmniboxPopupView::OpenSelectedLine( |
| 402 const ui::LocatedEvent& event, | 402 const ui::LocatedEvent& event, |
| 403 WindowOpenDisposition disposition) { | 403 WindowOpenDisposition disposition) { |
| 404 size_t index = GetIndexForPoint(event.location()); | 404 size_t index = GetIndexForPoint(event.location()); |
| 405 OpenIndex(index, disposition); | 405 OpenIndex(index, disposition); |
| 406 } | 406 } |
| OLD | NEW |