Content settings: remove some plugin-related code/resources when... there are no...
[chromium-blink-merge.git] / content / public / test / content_browser_test_utils_mac.mm
blob165a1776c9de0acf9928f1659a38431e69fac6b9
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
3 // found in the LICENSE file.
5 #include "content/public/test/content_browser_test_utils.h"
7 #include <Carbon/Carbon.h>
8 #import <Cocoa/Cocoa.h>
10 #include "ui/gfx/geometry/rect.h"
12 namespace content {
14 void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds) {
15   NSRect new_bounds = NSRectFromCGRect(bounds.ToCGRect());
16   if ([[NSScreen screens] count] > 0) {
17     new_bounds.origin.y =
18         [[[NSScreen screens] objectAtIndex:0] frame].size.height -
19         new_bounds.origin.y - new_bounds.size.height;
20   }
22   [window setFrame:new_bounds display:NO];
25 }  // namespace content