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/tabs/tab.h" | 5 #include "chrome/browser/ui/views/tabs/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/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 controller_->ExtendSelectionTo(this); | 865 controller_->ExtendSelectionTo(this); |
866 } else if (event.IsControlDown()) { | 866 } else if (event.IsControlDown()) { |
867 controller_->ToggleSelected(this); | 867 controller_->ToggleSelected(this); |
868 if (!IsSelected()) { | 868 if (!IsSelected()) { |
869 // Don't allow dragging non-selected tabs. | 869 // Don't allow dragging non-selected tabs. |
870 return false; | 870 return false; |
871 } | 871 } |
872 } else if (!IsSelected()) { | 872 } else if (!IsSelected()) { |
873 controller_->SelectTab(this); | 873 controller_->SelectTab(this); |
874 content::RecordAction(UserMetricsAction("SwitchTab_Click")); | 874 content::RecordAction(UserMetricsAction("SwitchTab_Click")); |
| 875 // TODO(bruthig): |
875 } | 876 } |
876 } else if (!IsSelected()) { | 877 } else if (!IsSelected()) { |
877 controller_->SelectTab(this); | 878 controller_->SelectTab(this); |
878 content::RecordAction(UserMetricsAction("SwitchTab_Click")); | 879 content::RecordAction(UserMetricsAction("SwitchTab_Click")); |
| 880 // TODO(bruthig): |
879 } | 881 } |
880 ui::MouseEvent cloned_event(event_in_parent, parent(), | 882 ui::MouseEvent cloned_event(event_in_parent, parent(), |
881 static_cast<View*>(this)); | 883 static_cast<View*>(this)); |
882 controller_->MaybeStartDrag(this, cloned_event, original_selection); | 884 controller_->MaybeStartDrag(this, cloned_event, original_selection); |
883 } | 885 } |
884 return true; | 886 return true; |
885 } | 887 } |
886 | 888 |
887 bool Tab::OnMouseDragged(const ui::MouseEvent& event) { | 889 bool Tab::OnMouseDragged(const ui::MouseEvent& event) { |
888 controller_->ContinueDrag(this, event); | 890 controller_->ContinueDrag(this, event); |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 const gfx::ImageSkia& image) { | 1573 const gfx::ImageSkia& image) { |
1572 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1574 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
1573 ImageCacheEntry entry; | 1575 ImageCacheEntry entry; |
1574 entry.resource_id = resource_id; | 1576 entry.resource_id = resource_id; |
1575 entry.scale_factor = scale_factor; | 1577 entry.scale_factor = scale_factor; |
1576 entry.image = image; | 1578 entry.image = image; |
1577 image_cache_->push_front(entry); | 1579 image_cache_->push_front(entry); |
1578 if (image_cache_->size() > kMaxImageCacheSize) | 1580 if (image_cache_->size() > kMaxImageCacheSize) |
1579 image_cache_->pop_back(); | 1581 image_cache_->pop_back(); |
1580 } | 1582 } |
OLD | NEW |