| 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 "content/shell/shell.h" | 5 #include "content/shell/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 void Shell::PlatformCreateWindow(int width, int height) { | 159 void Shell::PlatformCreateWindow(int width, int height) { |
| 160 NSRect initial_window_bounds = | 160 NSRect initial_window_bounds = |
| 161 NSMakeRect(0, 0, width, height + kURLBarHeight); | 161 NSMakeRect(0, 0, width, height + kURLBarHeight); |
| 162 NSRect content_rect = initial_window_bounds; | 162 NSRect content_rect = initial_window_bounds; |
| 163 NSUInteger style_mask = NSTitledWindowMask | | 163 NSUInteger style_mask = NSTitledWindowMask | |
| 164 NSClosableWindowMask | | 164 NSClosableWindowMask | |
| 165 NSMiniaturizableWindowMask | | 165 NSMiniaturizableWindowMask | |
| 166 NSResizableWindowMask; | 166 NSResizableWindowMask; |
| 167 if (headless_) { |
| 168 content_rect = NSOffsetRect(initial_window_bounds, -10000, -10000); |
| 169 style_mask = NSBorderlessWindowMask; |
| 170 } |
| 167 CrShellWindow* window = | 171 CrShellWindow* window = |
| 168 [[CrShellWindow alloc] initWithContentRect:content_rect | 172 [[CrShellWindow alloc] initWithContentRect:content_rect |
| 169 styleMask:style_mask | 173 styleMask:style_mask |
| 170 backing:NSBackingStoreBuffered | 174 backing:NSBackingStoreBuffered |
| 171 defer:NO]; | 175 defer:NO]; |
| 172 window_ = window; | 176 window_ = window; |
| 173 [window setShell:this]; | 177 [window setShell:this]; |
| 174 [window_ setTitle:kWindowTitle]; | 178 [window_ setTitle:kWindowTitle]; |
| 175 NSView* content = [window_ contentView]; | 179 NSView* content = [window_ contentView]; |
| 176 | 180 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 [[event.os_event characters] isEqual:@"l"]) { | 294 [[event.os_event characters] isEqual:@"l"]) { |
| 291 [window_ makeFirstResponder:url_edit_view_]; | 295 [window_ makeFirstResponder:url_edit_view_]; |
| 292 return; | 296 return; |
| 293 } | 297 } |
| 294 | 298 |
| 295 [[NSApp mainMenu] performKeyEquivalent:event.os_event]; | 299 [[NSApp mainMenu] performKeyEquivalent:event.os_event]; |
| 296 } | 300 } |
| 297 } | 301 } |
| 298 | 302 |
| 299 } // namespace content | 303 } // namespace content |
| OLD | NEW |