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/cocoa/extensions/shell_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h" |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" | 10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 NSRect cocoa_bounds = NSMakeRect(checked_bounds.x(), 0, | 267 NSRect cocoa_bounds = NSMakeRect(checked_bounds.x(), 0, |
268 checked_bounds.width(), | 268 checked_bounds.width(), |
269 checked_bounds.height()); | 269 checked_bounds.height()); |
270 // Flip coordinates based on the primary screen. | 270 // Flip coordinates based on the primary screen. |
271 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 271 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
272 cocoa_bounds.origin.y = NSHeight([screen frame]) - checked_bounds.bottom(); | 272 cocoa_bounds.origin.y = NSHeight([screen frame]) - checked_bounds.bottom(); |
273 | 273 |
274 [window() setFrame:cocoa_bounds display:YES]; | 274 [window() setFrame:cocoa_bounds display:YES]; |
275 } | 275 } |
276 | 276 |
277 void ShellWindowCocoa::SetDraggableRegion(SkRegion* region) { | |
278 // TODO: implement | |
279 } | |
280 | |
281 void ShellWindowCocoa::FlashFrame(bool flash) { | 277 void ShellWindowCocoa::FlashFrame(bool flash) { |
282 if (flash) { | 278 if (flash) { |
283 attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest]; | 279 attention_request_id_ = [NSApp requestUserAttention:NSInformationalRequest]; |
284 } else { | 280 } else { |
285 [NSApp cancelUserAttentionRequest:attention_request_id_]; | 281 [NSApp cancelUserAttentionRequest:attention_request_id_]; |
286 attention_request_id_ = 0; | 282 attention_request_id_ = 0; |
287 } | 283 } |
288 } | 284 } |
289 | 285 |
290 bool ShellWindowCocoa::IsAlwaysOnTop() const { | 286 bool ShellWindowCocoa::IsAlwaysOnTop() const { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 return [window_controller_ window]; | 320 return [window_controller_ window]; |
325 } | 321 } |
326 | 322 |
327 // static | 323 // static |
328 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 324 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
329 const extensions::Extension* extension, | 325 const extensions::Extension* extension, |
330 const GURL& url, | 326 const GURL& url, |
331 const ShellWindow::CreateParams& params) { | 327 const ShellWindow::CreateParams& params) { |
332 return new ShellWindowCocoa(profile, extension, url, params); | 328 return new ShellWindowCocoa(profile, extension, url, params); |
333 } | 329 } |
OLD | NEW |