| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/touch/tabs/touch_tab_strip.h" | 5 #include "chrome/browser/ui/touch/tabs/touch_tab_strip.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "chrome/browser/ui/touch/tabs/touch_tab.h" | 10 #include "chrome/browser/ui/touch/tabs/touch_tab.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } else { | 264 } else { |
| 265 scroll_offset_ = min_scroll_offset_; | 265 scroll_offset_ = min_scroll_offset_; |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 TouchTab* TouchTabStrip::GetTabAtTabDataIndex(int tab_data_index) const { | 270 TouchTab* TouchTabStrip::GetTabAtTabDataIndex(int tab_data_index) const { |
| 271 return static_cast<TouchTab*>(base_tab_at_tab_index(tab_data_index)); | 271 return static_cast<TouchTab*>(base_tab_at_tab_index(tab_data_index)); |
| 272 } | 272 } |
| 273 | 273 |
| 274 // Retrieves the Tab at the specified *model* index. |
| 275 TouchTab* TouchTabStrip::GetTouchTabAtModelIndex(int model_index) const { |
| 276 return static_cast<TouchTab*>(GetBaseTabAtModelIndex(model_index)); |
| 277 } |
| 278 |
| 274 //////////////////////////////////////////////////////////////////////////////// | 279 //////////////////////////////////////////////////////////////////////////////// |
| 275 // TouchTabStrip, private: | 280 // TouchTabStrip, private: |
| 276 | 281 |
| 277 void TouchTabStrip::Init() { | 282 void TouchTabStrip::Init() { |
| 278 set_id(VIEW_ID_TAB_STRIP); | 283 set_id(VIEW_ID_TAB_STRIP); |
| 279 } | 284 } |
| 280 | 285 |
| 281 //////////////////////////////////////////////////////////////////////////////// | 286 //////////////////////////////////////////////////////////////////////////////// |
| 282 // TouchTabStrip, views::View overrides, private: | 287 // TouchTabStrip, views::View overrides, private: |
| 283 | 288 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 last_tapped_view_ = view; | 358 last_tapped_view_ = view; |
| 354 return ui::TOUCH_STATUS_UNKNOWN; | 359 return ui::TOUCH_STATUS_UNKNOWN; |
| 355 } | 360 } |
| 356 | 361 |
| 357 void TouchTabStrip::ViewHierarchyChanged(bool is_add, | 362 void TouchTabStrip::ViewHierarchyChanged(bool is_add, |
| 358 View* parent, | 363 View* parent, |
| 359 View* child) { | 364 View* child) { |
| 360 if (!is_add && last_tapped_view_ == child) | 365 if (!is_add && last_tapped_view_ == child) |
| 361 last_tapped_view_ = NULL; | 366 last_tapped_view_ = NULL; |
| 362 } | 367 } |
| OLD | NEW |