| 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/views/tabs/base_tab.h" | 5 #include "chrome/browser/ui/views/tabs/base_tab.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } else if (event.IsShiftDown()) { | 294 } else if (event.IsShiftDown()) { |
| 295 controller()->ExtendSelectionTo(this); | 295 controller()->ExtendSelectionTo(this); |
| 296 } else if (event.IsControlDown()) { | 296 } else if (event.IsControlDown()) { |
| 297 controller()->ToggleSelected(this); | 297 controller()->ToggleSelected(this); |
| 298 if (!IsSelected()) { | 298 if (!IsSelected()) { |
| 299 // Don't allow dragging non-selected tabs. | 299 // Don't allow dragging non-selected tabs. |
| 300 return false; | 300 return false; |
| 301 } | 301 } |
| 302 } else if (!IsSelected()) { | 302 } else if (!IsSelected()) { |
| 303 controller()->SelectTab(this); | 303 controller()->SelectTab(this); |
| 304 } else if (IsActive()) { |
| 305 controller()->ClickActiveTab(this); |
| 304 } | 306 } |
| 305 controller()->MaybeStartDrag(this, event); | 307 controller()->MaybeStartDrag(this, event); |
| 306 } | 308 } |
| 307 return true; | 309 return true; |
| 308 } | 310 } |
| 309 | 311 |
| 310 bool BaseTab::OnMouseDragged(const views::MouseEvent& event) { | 312 bool BaseTab::OnMouseDragged(const views::MouseEvent& event) { |
| 311 if (controller()) | 313 if (controller()) |
| 312 controller()->ContinueDrag(event); | 314 controller()->ContinueDrag(event); |
| 313 return true; | 315 return true; |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // static | 591 // static |
| 590 void BaseTab::InitResources() { | 592 void BaseTab::InitResources() { |
| 591 static bool initialized = false; | 593 static bool initialized = false; |
| 592 if (!initialized) { | 594 if (!initialized) { |
| 593 initialized = true; | 595 initialized = true; |
| 594 font_ = new gfx::Font( | 596 font_ = new gfx::Font( |
| 595 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); | 597 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); |
| 596 font_height_ = font_->GetHeight(); | 598 font_height_ = font_->GetHeight(); |
| 597 } | 599 } |
| 598 } | 600 } |
| OLD | NEW |