| 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/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 pepper_fullscreen_window_.reset([[PepperFlashFullscreenWindow alloc] | 464 pepper_fullscreen_window_.reset([[PepperFlashFullscreenWindow alloc] |
| 465 initWithContentRect:[screen frame] | 465 initWithContentRect:[screen frame] |
| 466 styleMask:NSBorderlessWindowMask | 466 styleMask:NSBorderlessWindowMask |
| 467 backing:NSBackingStoreBuffered | 467 backing:NSBackingStoreBuffered |
| 468 defer:NO]); | 468 defer:NO]); |
| 469 [pepper_fullscreen_window_ setLevel:NSFloatingWindowLevel]; | 469 [pepper_fullscreen_window_ setLevel:NSFloatingWindowLevel]; |
| 470 [pepper_fullscreen_window_ setReleasedWhenClosed:NO]; | 470 [pepper_fullscreen_window_ setReleasedWhenClosed:NO]; |
| 471 [cocoa_view_ setCanBeKeyView:YES]; | 471 [cocoa_view_ setCanBeKeyView:YES]; |
| 472 [cocoa_view_ setFrame:[[pepper_fullscreen_window_ contentView] bounds]]; | 472 [cocoa_view_ setFrame:[[pepper_fullscreen_window_ contentView] bounds]]; |
| 473 [cocoa_view_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; | 473 [cocoa_view_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; |
| 474 // If the pepper fullscreen window isn't opaque then there are performance |
| 475 // issues when it's on the discrete GPU and the Chrome window is being drawn |
| 476 // to. http://crbug.com/171911 |
| 477 [pepper_fullscreen_window_ setOpaque:YES]; |
| 474 | 478 |
| 475 // Note that this forms a reference cycle between the fullscreen window and | 479 // Note that this forms a reference cycle between the fullscreen window and |
| 476 // the rwhvmac: The PepperFlashFullscreenWindow retains cocoa_view_, | 480 // the rwhvmac: The PepperFlashFullscreenWindow retains cocoa_view_, |
| 477 // but cocoa_view_ keeps pepper_fullscreen_window_ in an instance variable. | 481 // but cocoa_view_ keeps pepper_fullscreen_window_ in an instance variable. |
| 478 // This cycle is normally broken when -keyEvent: receives an <esc> key, which | 482 // This cycle is normally broken when -keyEvent: receives an <esc> key, which |
| 479 // explicitly calls Shutdown on the render_widget_host_, which calls | 483 // explicitly calls Shutdown on the render_widget_host_, which calls |
| 480 // Destroy() on RWHVMac, which drops the reference to | 484 // Destroy() on RWHVMac, which drops the reference to |
| 481 // pepper_fullscreen_window_. | 485 // pepper_fullscreen_window_. |
| 482 [[pepper_fullscreen_window_ contentView] addSubview:cocoa_view_]; | 486 [[pepper_fullscreen_window_ contentView] addSubview:cocoa_view_]; |
| 483 | 487 |
| (...skipping 2846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3330 if (!string) return NO; | 3334 if (!string) return NO; |
| 3331 | 3335 |
| 3332 // If the user is currently using an IME, confirm the IME input, | 3336 // If the user is currently using an IME, confirm the IME input, |
| 3333 // and then insert the text from the service, the same as TextEdit and Safari. | 3337 // and then insert the text from the service, the same as TextEdit and Safari. |
| 3334 [self confirmComposition]; | 3338 [self confirmComposition]; |
| 3335 [self insertText:string]; | 3339 [self insertText:string]; |
| 3336 return YES; | 3340 return YES; |
| 3337 } | 3341 } |
| 3338 | 3342 |
| 3339 @end | 3343 @end |
| OLD | NEW |