Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 2947593005: Use ContainsValue() instead of std::find() in chrome/browser/ui/ (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 Tab* other_tab = tab_at(i); 1173 Tab* other_tab = tab_at(i);
1174 if (IsTabSelected(other_tab)) { 1174 if (IsTabSelected(other_tab)) {
1175 tabs.push_back(other_tab); 1175 tabs.push_back(other_tab);
1176 if (other_tab == tab) { 1176 if (other_tab == tab) {
1177 size_to_selected = GetSizeNeededForTabs(tabs); 1177 size_to_selected = GetSizeNeededForTabs(tabs);
1178 x = size_to_selected - tab->width() + x; 1178 x = size_to_selected - tab->width() + x;
1179 } 1179 }
1180 } 1180 }
1181 } 1181 }
1182 DCHECK(!tabs.empty()); 1182 DCHECK(!tabs.empty());
1183 DCHECK(std::find(tabs.begin(), tabs.end(), tab) != tabs.end()); 1183 DCHECK(base::ContainsValue(tabs, tab));
1184 ui::ListSelectionModel selection_model; 1184 ui::ListSelectionModel selection_model;
1185 if (!original_selection.IsSelected(model_index)) 1185 if (!original_selection.IsSelected(model_index))
1186 selection_model.Copy(original_selection); 1186 selection_model.Copy(original_selection);
1187 // Delete the existing DragController before creating a new one. We do this as 1187 // Delete the existing DragController before creating a new one. We do this as
1188 // creating the DragController remembers the WebContents delegates and we need 1188 // creating the DragController remembers the WebContents delegates and we need
1189 // to make sure the existing DragController isn't still a delegate. 1189 // to make sure the existing DragController isn't still a delegate.
1190 drag_controller_.reset(); 1190 drag_controller_.reset();
1191 TabDragController::MoveBehavior move_behavior = 1191 TabDragController::MoveBehavior move_behavior =
1192 TabDragController::REORDER; 1192 TabDragController::REORDER;
1193 // Use MOVE_VISIBLE_TABS in the following conditions: 1193 // Use MOVE_VISIBLE_TABS in the following conditions:
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); 2788 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point);
2789 if (view) 2789 if (view)
2790 return view; 2790 return view;
2791 } 2791 }
2792 Tab* tab = FindTabForEvent(point); 2792 Tab* tab = FindTabForEvent(point);
2793 if (tab) 2793 if (tab)
2794 return ConvertPointToViewAndGetEventHandler(this, tab, point); 2794 return ConvertPointToViewAndGetEventHandler(this, tab, point);
2795 } 2795 }
2796 return this; 2796 return this;
2797 } 2797 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.cc ('k') | chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698