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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Currently the plugin IME implementation only works on 10.6. |
963 if (instance()->event_model() != NPEventModelCocoa || | 963 if (instance()->event_model() != NPEventModelCocoa) |
964 base::mac::IsOSLeopardOrEarlier()) { | |
965 return; | 964 return; |
966 } | |
967 if (ime_enabled_) | 965 if (ime_enabled_) |
968 return; | 966 return; |
969 ime_enabled_ = true; | 967 ime_enabled_ = true; |
970 plugin_->StartIme(); | 968 plugin_->StartIme(); |
971 } | 969 } |
972 | 970 |
973 #pragma mark - | 971 #pragma mark - |
974 #pragma mark Core Animation Support | 972 #pragma mark Core Animation Support |
975 | 973 |
976 void WebPluginDelegateImpl::DrawLayerInSurface() { | 974 void WebPluginDelegateImpl::DrawLayerInSurface() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 HIPoint mouse_location; | 1088 HIPoint mouse_location; |
1091 HIGetMousePosition(kHICoordSpaceScreenPixel, NULL, &mouse_location); | 1089 HIGetMousePosition(kHICoordSpaceScreenPixel, NULL, &mouse_location); |
1092 np_event.where.h = mouse_location.x; | 1090 np_event.where.h = mouse_location.x; |
1093 np_event.where.v = mouse_location.y; | 1091 np_event.where.v = mouse_location.y; |
1094 instance()->NPP_HandleEvent(&np_event); | 1092 instance()->NPP_HandleEvent(&np_event); |
1095 } | 1093 } |
1096 #endif // !NP_NO_CARBON | 1094 #endif // !NP_NO_CARBON |
1097 | 1095 |
1098 } // namespace npapi | 1096 } // namespace npapi |
1099 } // namespace webkit | 1097 } // namespace webkit |
OLD | NEW |