| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 // RenderWidgetHostViewMac, public: | 588 // RenderWidgetHostViewMac, public: |
| 589 | 589 |
| 590 RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget) | 590 RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget) |
| 591 : render_widget_host_(widget), | 591 : render_widget_host_(widget), |
| 592 about_to_validate_and_paint_(false), | 592 about_to_validate_and_paint_(false), |
| 593 call_set_needs_display_in_rect_pending_(false), | 593 call_set_needs_display_in_rect_pending_(false), |
| 594 text_input_type_(WebKit::WebTextInputTypeNone), | 594 text_input_type_(WebKit::WebTextInputTypeNone), |
| 595 is_loading_(false), | 595 is_loading_(false), |
| 596 is_hidden_(false), | 596 is_hidden_(false), |
| 597 shutdown_factory_(this), | 597 shutdown_factory_(this), |
| 598 needs_gpu_visibility_update_after_repaint_(false) { | 598 needs_gpu_visibility_update_after_repaint_(false), |
| 599 compositing_surface_(gfx::kNullPluginWindow) { |
| 599 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| goes away. | 600 // |cocoa_view_| owns us and we will be deleted when |cocoa_view_| goes away. |
| 600 // Since we autorelease it, our caller must put |native_view()| into the view | 601 // Since we autorelease it, our caller must put |native_view()| into the view |
| 601 // hierarchy right after calling us. | 602 // hierarchy right after calling us. |
| 602 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] | 603 cocoa_view_ = [[[RenderWidgetHostViewCocoa alloc] |
| 603 initWithRenderWidgetHostViewMac:this] autorelease]; | 604 initWithRenderWidgetHostViewMac:this] autorelease]; |
| 604 render_widget_host_->set_view(this); | 605 render_widget_host_->set_view(this); |
| 605 | 606 |
| 606 // Turn on accessibility only if VoiceOver is running. | 607 // Turn on accessibility only if VoiceOver is running. |
| 607 if (IsVoiceOverRunning()) { | 608 if (IsVoiceOverRunning()) { |
| 608 BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); | 609 BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 void RenderWidgetHostViewMac::GpuRenderingStateDidChange() { | 1291 void RenderWidgetHostViewMac::GpuRenderingStateDidChange() { |
| 1291 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1292 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1292 if (GetRenderWidgetHost()->is_accelerated_compositing_active()) { | 1293 if (GetRenderWidgetHost()->is_accelerated_compositing_active()) { |
| 1293 UpdateRootGpuViewVisibility( | 1294 UpdateRootGpuViewVisibility( |
| 1294 GetRenderWidgetHost()->is_accelerated_compositing_active()); | 1295 GetRenderWidgetHost()->is_accelerated_compositing_active()); |
| 1295 } else { | 1296 } else { |
| 1296 needs_gpu_visibility_update_after_repaint_ = true; | 1297 needs_gpu_visibility_update_after_repaint_ = true; |
| 1297 } | 1298 } |
| 1298 } | 1299 } |
| 1299 | 1300 |
| 1300 gfx::PluginWindowHandle RenderWidgetHostViewMac::AcquireCompositingSurface() { | 1301 gfx::PluginWindowHandle RenderWidgetHostViewMac::GetCompositingSurface() { |
| 1301 return AllocateFakePluginWindowHandle(/*opaque=*/true, /*root=*/true); | 1302 if (compositing_surface_ == gfx::kNullPluginWindow) |
| 1302 } | 1303 compositing_surface_ = AllocateFakePluginWindowHandle( |
| 1303 | 1304 /*opaque=*/true, /*root=*/true); |
| 1304 void RenderWidgetHostViewMac::ReleaseCompositingSurface( | 1305 return compositing_surface_; |
| 1305 gfx::PluginWindowHandle surface) { | |
| 1306 DestroyFakePluginWindowHandle(surface); | |
| 1307 } | 1306 } |
| 1308 | 1307 |
| 1309 void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance( | 1308 void RenderWidgetHostViewMac::DrawAcceleratedSurfaceInstance( |
| 1310 CGLContextObj context, | 1309 CGLContextObj context, |
| 1311 gfx::PluginWindowHandle plugin_handle, | 1310 gfx::PluginWindowHandle plugin_handle, |
| 1312 NSSize size) { | 1311 NSSize size) { |
| 1313 // Called on the display link thread. | 1312 // Called on the display link thread. |
| 1314 CGLSetCurrentContext(context); | 1313 CGLSetCurrentContext(context); |
| 1315 | 1314 |
| 1316 glMatrixMode(GL_PROJECTION); | 1315 glMatrixMode(GL_PROJECTION); |
| (...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2937 if (!string) return NO; | 2936 if (!string) return NO; |
| 2938 | 2937 |
| 2939 // If the user is currently using an IME, confirm the IME input, | 2938 // If the user is currently using an IME, confirm the IME input, |
| 2940 // and then insert the text from the service, the same as TextEdit and Safari. | 2939 // and then insert the text from the service, the same as TextEdit and Safari. |
| 2941 [self confirmComposition]; | 2940 [self confirmComposition]; |
| 2942 [self insertText:string]; | 2941 [self insertText:string]; |
| 2943 return YES; | 2942 return YES; |
| 2944 } | 2943 } |
| 2945 | 2944 |
| 2946 @end | 2945 @end |
| OLD | NEW |