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_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 old_selection.selected_indices(), | 1013 old_selection.selected_indices(), |
1014 new_selection.selected_indices()); | 1014 new_selection.selected_indices()); |
1015 ui::ListSelectionModel::SelectedIndices newly_selected = | 1015 ui::ListSelectionModel::SelectedIndices newly_selected = |
1016 base::STLSetDifference<ui::ListSelectionModel::SelectedIndices>( | 1016 base::STLSetDifference<ui::ListSelectionModel::SelectedIndices>( |
1017 new_selection.selected_indices(), | 1017 new_selection.selected_indices(), |
1018 old_selection.selected_indices()); | 1018 old_selection.selected_indices()); |
1019 | 1019 |
1020 // Fire accessibility events that reflect the changes to selection, and | 1020 // Fire accessibility events that reflect the changes to selection, and |
1021 // stop the pinned tab title animation on tabs no longer selected. | 1021 // stop the pinned tab title animation on tabs no longer selected. |
1022 for (size_t i = 0; i < no_longer_selected.size(); ++i) { | 1022 for (size_t i = 0; i < no_longer_selected.size(); ++i) { |
1023 tab_at(no_longer_selected[i])->StopPinnedTabTitleAnimation(); | 1023 tab_at(no_longer_selected[i]) |
| 1024 ->SetPinnedTabTitleChangedIndicatorVisible(false); |
1024 tab_at(no_longer_selected[i])->NotifyAccessibilityEvent( | 1025 tab_at(no_longer_selected[i])->NotifyAccessibilityEvent( |
1025 ui::AX_EVENT_SELECTION_REMOVE, true); | 1026 ui::AX_EVENT_SELECTION_REMOVE, true); |
1026 } | 1027 } |
1027 for (size_t i = 0; i < newly_selected.size(); ++i) { | 1028 for (size_t i = 0; i < newly_selected.size(); ++i) { |
1028 tab_at(newly_selected[i])->NotifyAccessibilityEvent( | 1029 tab_at(newly_selected[i])->NotifyAccessibilityEvent( |
1029 ui::AX_EVENT_SELECTION_ADD, true); | 1030 ui::AX_EVENT_SELECTION_ADD, true); |
1030 } | 1031 } |
1031 tab_at(new_selection.active())->NotifyAccessibilityEvent( | 1032 tab_at(new_selection.active())->NotifyAccessibilityEvent( |
1032 ui::AX_EVENT_SELECTION, true); | 1033 ui::AX_EVENT_SELECTION, true); |
1033 } | 1034 } |
1034 | 1035 |
1035 void TabStrip::TabTitleChangedNotLoading(int model_index) { | 1036 void TabStrip::TabTitleChangedNotLoading(int model_index) { |
1036 Tab* tab = tab_at(model_index); | 1037 Tab* tab = tab_at(model_index); |
1037 if (tab->data().pinned && !tab->IsActive()) | 1038 if (tab->data().pinned && !tab->IsActive()) |
1038 tab->StartPinnedTabTitleAnimation(); | 1039 tab->SetPinnedTabTitleChangedIndicatorVisible(true); |
1039 } | 1040 } |
1040 | 1041 |
1041 int TabStrip::GetModelIndexOfTab(const Tab* tab) const { | 1042 int TabStrip::GetModelIndexOfTab(const Tab* tab) const { |
1042 return tabs_.GetIndexOfView(tab); | 1043 return tabs_.GetIndexOfView(tab); |
1043 } | 1044 } |
1044 | 1045 |
1045 int TabStrip::GetModelCount() const { | 1046 int TabStrip::GetModelCount() const { |
1046 return controller_->GetCount(); | 1047 return controller_->GetCount(); |
1047 } | 1048 } |
1048 | 1049 |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2888 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2888 if (view) | 2889 if (view) |
2889 return view; | 2890 return view; |
2890 } | 2891 } |
2891 Tab* tab = FindTabForEvent(point); | 2892 Tab* tab = FindTabForEvent(point); |
2892 if (tab) | 2893 if (tab) |
2893 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2894 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2894 } | 2895 } |
2895 return this; | 2896 return this; |
2896 } | 2897 } |
OLD | NEW |