| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 #import <QuartzCore/QuartzCore.h> | 6 #import <QuartzCore/QuartzCore.h> |
| 7 | 7 |
| 8 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 8 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 redraw_timer_->Start(FROM_HERE, | 952 redraw_timer_->Start(FROM_HERE, |
| 953 base::TimeDelta::FromMilliseconds(kCoreAnimationRedrawPeriodMs), | 953 base::TimeDelta::FromMilliseconds(kCoreAnimationRedrawPeriodMs), |
| 954 this, &WebPluginDelegateImpl::DrawLayerInSurface); | 954 this, &WebPluginDelegateImpl::DrawLayerInSurface); |
| 955 } else if (!plugin_visible) { | 955 } else if (!plugin_visible) { |
| 956 redraw_timer_->Stop(); | 956 redraw_timer_->Stop(); |
| 957 } | 957 } |
| 958 } | 958 } |
| 959 } | 959 } |
| 960 | 960 |
| 961 void WebPluginDelegateImpl::StartIme() { | 961 void WebPluginDelegateImpl::StartIme() { |
| 962 // Currently the plugin IME implementation only works on 10.6. | 962 if (instance()->event_model() != NPEventModelCocoa) |
| 963 if (instance()->event_model() != NPEventModelCocoa || | |
| 964 base::mac::IsOSLeopardOrEarlier()) { | |
| 965 return; | 963 return; |
| 966 } | |
| 967 if (ime_enabled_) | 964 if (ime_enabled_) |
| 968 return; | 965 return; |
| 969 ime_enabled_ = true; | 966 ime_enabled_ = true; |
| 970 plugin_->StartIme(); | 967 plugin_->StartIme(); |
| 971 } | 968 } |
| 972 | 969 |
| 973 #pragma mark - | 970 #pragma mark - |
| 974 #pragma mark Core Animation Support | 971 #pragma mark Core Animation Support |
| 975 | 972 |
| 976 void WebPluginDelegateImpl::DrawLayerInSurface() { | 973 void WebPluginDelegateImpl::DrawLayerInSurface() { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 HIPoint mouse_location; | 1087 HIPoint mouse_location; |
| 1091 HIGetMousePosition(kHICoordSpaceScreenPixel, NULL, &mouse_location); | 1088 HIGetMousePosition(kHICoordSpaceScreenPixel, NULL, &mouse_location); |
| 1092 np_event.where.h = mouse_location.x; | 1089 np_event.where.h = mouse_location.x; |
| 1093 np_event.where.v = mouse_location.y; | 1090 np_event.where.v = mouse_location.y; |
| 1094 instance()->NPP_HandleEvent(&np_event); | 1091 instance()->NPP_HandleEvent(&np_event); |
| 1095 } | 1092 } |
| 1096 #endif // !NP_NO_CARBON | 1093 #endif // !NP_NO_CARBON |
| 1097 | 1094 |
| 1098 } // namespace npapi | 1095 } // namespace npapi |
| 1099 } // namespace webkit | 1096 } // namespace webkit |
| OLD | NEW |