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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm

Issue 1715683002: chrome: Use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing non ContainsValue changes Created 4 years, 9 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 9
10 #include "base/mac/sdk_forward_declarations.h" 10 #include "base/mac/sdk_forward_declarations.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/stl_util.h"
13 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/app/chrome_command_ids.h" 15 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/devtools/devtools_window_testing.h" 17 #include "chrome/browser/devtools/devtools_window_testing.h"
17 #include "chrome/browser/fullscreen.h" 18 #include "chrome/browser/fullscreen.h"
18 #include "chrome/browser/infobars/infobar_service.h" 19 #include "chrome/browser/infobars/infobar_service.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
21 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 22 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
22 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 for (size_t i = 0; i < visible_views.size() - 1; ++i) { 255 for (size_t i = 0; i < visible_views.size() - 1; ++i) {
255 NSView* bottom_view = visible_views[i]; 256 NSView* bottom_view = visible_views[i];
256 NSView* top_view = visible_views[i + 1]; 257 NSView* top_view = visible_views[i + 1];
257 258
258 EXPECT_NSEQ([bottom_view superview], [top_view superview]); 259 EXPECT_NSEQ([bottom_view superview], [top_view superview]);
259 EXPECT_TRUE([bottom_view cr_isBelowView:top_view]); 260 EXPECT_TRUE([bottom_view cr_isBelowView:top_view]);
260 } 261 }
261 262
262 // Views not in |view_list| must either be nil or not parented. 263 // Views not in |view_list| must either be nil or not parented.
263 for (size_t i = 0; i < VIEW_ID_COUNT; ++i) { 264 for (size_t i = 0; i < VIEW_ID_COUNT; ++i) {
264 if (std::find(view_list.begin(), view_list.end(), i) == view_list.end()) { 265 if (!ContainsValue(view_list, i)) {
265 NSView* view = GetViewWithID(static_cast<ViewID>(i)); 266 NSView* view = GetViewWithID(static_cast<ViewID>(i));
266 EXPECT_TRUE(!view || ![view superview]); 267 EXPECT_TRUE(!view || ![view superview]);
267 } 268 }
268 } 269 }
269 } 270 }
270 271
271 CGFloat GetViewHeight(ViewID viewID) const { 272 CGFloat GetViewHeight(ViewID viewID) const {
272 CGFloat height = NSHeight([GetViewWithID(viewID) frame]); 273 CGFloat height = NSHeight([GetViewWithID(viewID) frame]);
273 if (viewID == VIEW_ID_INFO_BAR) { 274 if (viewID == VIEW_ID_INFO_BAR) {
274 height -= [[controller() infoBarContainerController] 275 height -= [[controller() infoBarContainerController]
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 715
715 // Toggle out and back into fullscreen and verify that the toolbar is still 716 // Toggle out and back into fullscreen and verify that the toolbar is still
716 // hidden. 717 // hidden.
717 ToggleFullscreenAndWaitForNotification(); 718 ToggleFullscreenAndWaitForNotification();
718 ToggleFullscreenAndWaitForNotification(); 719 ToggleFullscreenAndWaitForNotification();
719 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN); 720 VerifyFullscreenToolbarVisibility(fullscreen_mac::OMNIBOX_TABS_HIDDEN);
720 721
721 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR); 722 chrome::ExecuteCommand(browser(), IDC_TOGGLE_FULLSCREEN_TOOLBAR);
722 EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar)); 723 EXPECT_TRUE(prefs->GetBoolean(prefs::kShowFullscreenToolbar));
723 } 724 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698