| 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/frame/browser_root_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 8 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
| 9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // tab-strip. | 144 // tab-strip. |
| 145 if (scroll_offset > 0 && model->active_index() > 0) { | 145 if (scroll_offset > 0 && model->active_index() > 0) { |
| 146 chrome::SelectPreviousTab(browser); | 146 chrome::SelectPreviousTab(browser); |
| 147 return true; | 147 return true; |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 return RootView::OnMouseWheel(event); | 151 return RootView::OnMouseWheel(event); |
| 152 } | 152 } |
| 153 | 153 |
| 154 ui::EventDispatchDetails BrowserRootView::OnEventFromSource(ui::Event* event) { | 154 bool BrowserRootView::OnEventProcessingStarted(ui::Event* event) { |
| 155 if (event->IsGestureEvent()) { | 155 if (event->IsGestureEvent()) { |
| 156 ui::GestureEvent* gesture_event = event->AsGestureEvent(); | 156 ui::GestureEvent* gesture_event = event->AsGestureEvent(); |
| 157 if (gesture_event->type() == ui::ET_GESTURE_TAP && | 157 if (gesture_event->type() == ui::ET_GESTURE_TAP && |
| 158 gesture_event->location().y() <= 0 && | 158 gesture_event->location().y() <= 0 && |
| 159 gesture_event->location().x() <= browser_view_->GetBounds().width()) { | 159 gesture_event->location().x() <= browser_view_->GetBounds().width()) { |
| 160 TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP); | 160 TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 | 163 |
| 164 return RootView::OnEventFromSource(event); | 164 return RootView::OnEventProcessingStarted(event); |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool BrowserRootView::ShouldForwardToTabStrip( | 167 bool BrowserRootView::ShouldForwardToTabStrip( |
| 168 const ui::DropTargetEvent& event) { | 168 const ui::DropTargetEvent& event) { |
| 169 if (!tabstrip()->visible()) | 169 if (!tabstrip()->visible()) |
| 170 return false; | 170 return false; |
| 171 | 171 |
| 172 // Allow the drop as long as the mouse is over the tabstrip or vertically | 172 // Allow the drop as long as the mouse is over the tabstrip or vertically |
| 173 // before it. | 173 // before it. |
| 174 gfx::Point tab_loc_in_host; | 174 gfx::Point tab_loc_in_host; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 204 browser_view_->browser()->profile())->Classify( | 204 browser_view_->browser()->profile())->Classify( |
| 205 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, | 205 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, |
| 206 NULL); | 206 NULL); |
| 207 if (!match.destination_url.is_valid()) | 207 if (!match.destination_url.is_valid()) |
| 208 return false; | 208 return false; |
| 209 | 209 |
| 210 if (url) | 210 if (url) |
| 211 *url = match.destination_url; | 211 *url = match.destination_url; |
| 212 return true; | 212 return true; |
| 213 } | 213 } |
| OLD | NEW |