Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10091003: Convert flash to thunk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 sad_plugin_(NULL), 309 sad_plugin_(NULL),
310 input_event_mask_(0), 310 input_event_mask_(0),
311 filtered_input_event_mask_(0), 311 filtered_input_event_mask_(0),
312 text_input_type_(kPluginDefaultTextInputType), 312 text_input_type_(kPluginDefaultTextInputType),
313 text_input_caret_(0, 0, 0, 0), 313 text_input_caret_(0, 0, 0, 0),
314 text_input_caret_bounds_(0, 0, 0, 0), 314 text_input_caret_bounds_(0, 0, 0, 0),
315 text_input_caret_set_(false), 315 text_input_caret_set_(false),
316 selection_caret_(0), 316 selection_caret_(0),
317 selection_anchor_(0), 317 selection_anchor_(0),
318 lock_mouse_callback_(PP_BlockUntilComplete()), 318 lock_mouse_callback_(PP_BlockUntilComplete()),
319 pending_user_gesture_(0.0) { 319 pending_user_gesture_(0.0),
320 flash_impl_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
320 pp_instance_ = HostGlobals::Get()->AddInstance(this); 321 pp_instance_ = HostGlobals::Get()->AddInstance(this);
321 322
322 memset(&current_print_settings_, 0, sizeof(current_print_settings_)); 323 memset(&current_print_settings_, 0, sizeof(current_print_settings_));
323 DCHECK(delegate); 324 DCHECK(delegate);
324 module_->InstanceCreated(this); 325 module_->InstanceCreated(this);
325 delegate_->InstanceCreated(this); 326 delegate_->InstanceCreated(this);
326 message_channel_.reset(new MessageChannel(this)); 327 message_channel_.reset(new MessageChannel(this));
327 328
328 view_data_.is_page_visible = delegate->IsPageVisible(); 329 view_data_.is_page_visible = delegate->IsPageVisible();
329 } 330 }
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 delegate_->NumberOfFindResultsChanged(find_identifier_, total, 1918 delegate_->NumberOfFindResultsChanged(find_identifier_, total,
1918 PP_ToBool(final_result)); 1919 PP_ToBool(final_result));
1919 } 1920 }
1920 1921
1921 void PluginInstance::SelectedFindResultChanged(PP_Instance instance, 1922 void PluginInstance::SelectedFindResultChanged(PP_Instance instance,
1922 int32_t index) { 1923 int32_t index) {
1923 DCHECK_NE(find_identifier_, -1); 1924 DCHECK_NE(find_identifier_, -1);
1924 delegate_->SelectedFindResultChanged(find_identifier_, index); 1925 delegate_->SelectedFindResultChanged(find_identifier_, index);
1925 } 1926 }
1926 1927
1927 PP_Bool PluginInstance::FlashIsFullscreen(PP_Instance instance) {
1928 return PP_FromBool(flash_fullscreen_);
1929 }
1930
1931 PP_Bool PluginInstance::SetFullscreen(PP_Instance instance, 1928 PP_Bool PluginInstance::SetFullscreen(PP_Instance instance,
1932 PP_Bool fullscreen) { 1929 PP_Bool fullscreen) {
1933 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); 1930 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen)));
1934 } 1931 }
1935 1932
1936 PP_Bool PluginInstance::FlashSetFullscreen(PP_Instance instance,
1937 PP_Bool fullscreen) {
1938 FlashSetFullscreen(PP_ToBool(fullscreen), true);
1939 return PP_TRUE;
1940 }
1941
1942 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) { 1933 PP_Bool PluginInstance::GetScreenSize(PP_Instance instance, PP_Size* size) {
1943 gfx::Size screen_size = delegate()->GetScreenSize(); 1934 gfx::Size screen_size = delegate()->GetScreenSize();
1944 *size = PP_MakeSize(screen_size.width(), screen_size.height()); 1935 *size = PP_MakeSize(screen_size.width(), screen_size.height());
1945 return PP_TRUE; 1936 return PP_TRUE;
1946 } 1937 }
1947 1938
1948 PP_Bool PluginInstance::FlashGetScreenSize(PP_Instance instance, 1939 ::ppapi::thunk::PPB_Flash_API* PluginInstance::GetFlashAPI() {
1949 PP_Size* size) { 1940 return &flash_impl_;
1950 return GetScreenSize(instance, size);
1951 } 1941 }
1952 1942
1953 int32_t PluginInstance::RequestInputEvents(PP_Instance instance, 1943 int32_t PluginInstance::RequestInputEvents(PP_Instance instance,
1954 uint32_t event_classes) { 1944 uint32_t event_classes) {
1955 input_event_mask_ |= event_classes; 1945 input_event_mask_ |= event_classes;
1956 filtered_input_event_mask_ &= ~(event_classes); 1946 filtered_input_event_mask_ &= ~(event_classes);
1957 return ValidateRequestInputEvents(false, event_classes); 1947 return ValidateRequestInputEvents(false, event_classes);
1958 } 1948 }
1959 1949
1960 int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance, 1950 int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 screen_size_for_fullscreen_ = gfx::Size(); 2175 screen_size_for_fullscreen_ = gfx::Size();
2186 WebElement element = container_->element(); 2176 WebElement element = container_->element();
2187 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2177 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2188 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2178 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2189 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2179 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2190 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2180 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2191 } 2181 }
2192 2182
2193 } // namespace ppapi 2183 } // namespace ppapi
2194 } // namespace webkit 2184 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698