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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 if (browser_defaults::kScrollEventChangesTab) { | 124 if (browser_defaults::kScrollEventChangesTab) { |
125 // Switch to the left/right tab if the wheel-scroll happens over the | 125 // Switch to the left/right tab if the wheel-scroll happens over the |
126 // tabstrip, or the empty space beside the tabstrip. | 126 // tabstrip, or the empty space beside the tabstrip. |
127 views::View* hit_view = GetEventHandlerForPoint(event.location()); | 127 views::View* hit_view = GetEventHandlerForPoint(event.location()); |
128 int hittest = | 128 int hittest = |
129 GetWidget()->non_client_view()->NonClientHitTest(event.location()); | 129 GetWidget()->non_client_view()->NonClientHitTest(event.location()); |
130 if (tabstrip()->Contains(hit_view) || | 130 if (tabstrip()->Contains(hit_view) || |
131 hittest == HTCAPTION || | 131 hittest == HTCAPTION || |
132 hittest == HTTOP) { | 132 hittest == HTTOP) { |
133 int scroll_offset = abs(event.y_offset()) > abs(event.x_offset()) ? | 133 int scroll_offset = abs(event.y_offset()) > abs(event.x_offset()) ? |
134 event.y_offset() : -event.x_offset(); | 134 event.y_offset() : event.x_offset(); |
135 Browser* browser = browser_view_->browser(); | 135 Browser* browser = browser_view_->browser(); |
136 TabStripModel* model = browser->tab_strip_model(); | 136 TabStripModel* model = browser->tab_strip_model(); |
137 // Switch to the next tab only if not at the end of the tab-strip. | 137 // Switch to the next tab only if not at the end of the tab-strip. |
138 if (scroll_offset < 0 && model->active_index() + 1 < model->count()) { | 138 if (scroll_offset < 0 && model->active_index() + 1 < model->count()) { |
139 chrome::SelectNextTab(browser); | 139 chrome::SelectNextTab(browser); |
140 return true; | 140 return true; |
141 } | 141 } |
142 | 142 |
143 // Switch to the previous tab only if not at the beginning of the | 143 // Switch to the previous tab only if not at the beginning of the |
144 // tab-strip. | 144 // tab-strip. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 nullptr); | 206 nullptr); |
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 |