Chromium Code Reviews| 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/autocomplete/autocomplete_match.h" | 9 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.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 void BrowserRootView::DispatchGestureEvent(ui::GestureEvent* event) { | 154 ui::EventDispatchDetails BrowserRootView::OnEventFromSource(ui::Event* event) { |
| 155 if (event->type() == ui::ET_GESTURE_TAP && | 155 if (event->IsGestureEvent()) { |
| 156 event->location().y() <= 0 && | 156 ui::GestureEvent* gesture_event = static_cast<ui::GestureEvent*>(event); |
| 157 event->location().x() <= browser_view_->GetBounds().width()) { | 157 if (gesture_event->type() == ui::ET_GESTURE_TAP && |
| 158 TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP); | 158 gesture_event->location().y() <= 0 && |
| 159 gesture_event->location().x() <= browser_view_->GetBounds().width()) { | |
| 160 TouchUMA::RecordGestureAction(TouchUMA::GESTURE_ROOTVIEWTOP_TAP); | |
| 161 } | |
| 159 } | 162 } |
| 160 | 163 |
| 161 RootView::DispatchGestureEvent(event); | 164 // TODO(tdanderson): Instead call up to EventProcessor::OnEventFromSource() |
| 165 // once RootView::OnEventFromSource() is removed. | |
|
sadrul
2014/07/15 18:23:46
You can actually leave this as it is when you remo
tdanderson
2014/07/15 20:25:40
Right, I just thought it would be slightly better
| |
| 166 return RootView::OnEventFromSource(event); | |
| 162 } | 167 } |
| 163 | 168 |
| 164 bool BrowserRootView::ShouldForwardToTabStrip( | 169 bool BrowserRootView::ShouldForwardToTabStrip( |
| 165 const ui::DropTargetEvent& event) { | 170 const ui::DropTargetEvent& event) { |
| 166 if (!tabstrip()->visible()) | 171 if (!tabstrip()->visible()) |
| 167 return false; | 172 return false; |
| 168 | 173 |
| 169 // Allow the drop as long as the mouse is over the tabstrip or vertically | 174 // Allow the drop as long as the mouse is over the tabstrip or vertically |
| 170 // before it. | 175 // before it. |
| 171 gfx::Point tab_loc_in_host; | 176 gfx::Point tab_loc_in_host; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 201 browser_view_->browser()->profile())->Classify( | 206 browser_view_->browser()->profile())->Classify( |
| 202 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, | 207 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, |
| 203 NULL); | 208 NULL); |
| 204 if (!match.destination_url.is_valid()) | 209 if (!match.destination_url.is_valid()) |
| 205 return false; | 210 return false; |
| 206 | 211 |
| 207 if (url) | 212 if (url) |
| 208 *url = match.destination_url; | 213 *url = match.destination_url; |
| 209 return true; | 214 return true; |
| 210 } | 215 } |
| OLD | NEW |