| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/views/tabs/tab_strip_2.h" | 5 #include "chrome/browser/views/tabs/tab_strip_2.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/slide_animation.h" | 8 #include "app/slide_animation.h" |
| 9 #include "app/win_util.h" | 9 #include "app/win_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "views/animator.h" | 13 #include "views/animator.h" |
| 14 #include "views/screen.h" | 14 #include "views/screen.h" |
| 15 #include "views/widget/widget.h" | 15 #include "views/widget/widget.h" |
| 16 #include "views/window/non_client_view.h" | 16 #include "views/window/non_client_view.h" |
| 17 #include "views/window/window.h" | 17 #include "views/window/window.h" |
| 18 | 18 |
| 19 static const int kHorizontalMoveThreshold = 16; // pixels | 19 static const int kHorizontalMoveThreshold = 16; // pixels |
| 20 | 20 |
| 21 //////////////////////////////////////////////////////////////////////////////// | 21 //////////////////////////////////////////////////////////////////////////////// |
| 22 // TabStrip2, public: | 22 // TabStrip2, public: |
| 23 | 23 |
| 24 TabStrip2::TabStrip2(TabStrip2Model* model) | 24 TabStrip2::TabStrip2(TabStrip2Model* model) |
| 25 : model_(model), | 25 : model_(model), |
| 26 last_move_screen_x_(0), | 26 last_move_screen_x_(0), |
| 27 detach_factory_(this), | 27 ALLOW_THIS_IN_INITIALIZER_LIST(detach_factory_(this)), |
| 28 drag_start_factory_(this) { | 28 ALLOW_THIS_IN_INITIALIZER_LIST(drag_start_factory_(this)) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 TabStrip2::~TabStrip2() { | 31 TabStrip2::~TabStrip2() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 bool TabStrip2::Enabled() { | 35 bool TabStrip2::Enabled() { |
| 36 return CommandLine::ForCurrentProcess()->HasSwitch( | 36 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 37 switches::kEnableTabtastic2); | 37 switches::kEnableTabtastic2); |
| 38 } | 38 } |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 for (it = tabs_.begin(); it != tabs_.end(); ++it) { | 397 for (it = tabs_.begin(); it != tabs_.end(); ++it) { |
| 398 if (public_index >= valid_tab_count) | 398 if (public_index >= valid_tab_count) |
| 399 break; | 399 break; |
| 400 if ((*it)->removing()) | 400 if ((*it)->removing()) |
| 401 ++internal_index; | 401 ++internal_index; |
| 402 else | 402 else |
| 403 ++valid_tab_count; | 403 ++valid_tab_count; |
| 404 } | 404 } |
| 405 return internal_index; | 405 return internal_index; |
| 406 } | 406 } |
| OLD | NEW |