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

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

Issue 9391013: Make a global enum to differentiate impl & proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 589 }
590 } 590 }
591 591
592 // Send the event. 592 // Send the event.
593 bool handled = false; 593 bool handled = false;
594 if (filtered_input_event_mask_ & event_class) 594 if (filtered_input_event_mask_ & event_class)
595 event.is_filtered = true; 595 event.is_filtered = true;
596 else 596 else
597 handled = true; // Unfiltered events are assumed to be handled. 597 handled = true; // Unfiltered events are assumed to be handled.
598 scoped_refptr<PPB_InputEvent_Shared> event_resource( 598 scoped_refptr<PPB_InputEvent_Shared> event_resource(
599 new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), 599 new PPB_InputEvent_Shared(::ppapi::OBJECT_IS_IMPL, pp_instance(), event));
600 pp_instance(), event));
601 handled |= PP_ToBool(plugin_input_event_interface_->HandleInputEvent( 600 handled |= PP_ToBool(plugin_input_event_interface_->HandleInputEvent(
602 pp_instance(), event_resource->pp_resource())); 601 pp_instance(), event_resource->pp_resource()));
603 return handled; 602 return handled;
604 } 603 }
605 604
606 bool PluginInstance::HandleCompositionStart(const string16& text) { 605 bool PluginInstance::HandleCompositionStart(const string16& text) {
607 return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_START, 606 return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_START,
608 text); 607 text);
609 } 608 }
610 609
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 std::vector< ::ppapi::InputEventData > events; 689 std::vector< ::ppapi::InputEventData > events;
691 CreateInputEventData(event, &events); 690 CreateInputEventData(event, &events);
692 691
693 // Each input event may generate more than one PP_InputEvent. 692 // Each input event may generate more than one PP_InputEvent.
694 for (size_t i = 0; i < events.size(); i++) { 693 for (size_t i = 0; i < events.size(); i++) {
695 if (filtered_input_event_mask_ & event_class) 694 if (filtered_input_event_mask_ & event_class)
696 events[i].is_filtered = true; 695 events[i].is_filtered = true;
697 else 696 else
698 rv = true; // Unfiltered events are assumed to be handled. 697 rv = true; // Unfiltered events are assumed to be handled.
699 scoped_refptr<PPB_InputEvent_Shared> event_resource( 698 scoped_refptr<PPB_InputEvent_Shared> event_resource(
700 new PPB_InputEvent_Shared(PPB_InputEvent_Shared::InitAsImpl(), 699 new PPB_InputEvent_Shared(::ppapi::OBJECT_IS_IMPL,
701 pp_instance(), events[i])); 700 pp_instance(), events[i]));
702 701
703 rv |= PP_ToBool(plugin_input_event_interface_->HandleInputEvent( 702 rv |= PP_ToBool(plugin_input_event_interface_->HandleInputEvent(
704 pp_instance(), event_resource->pp_resource())); 703 pp_instance(), event_resource->pp_resource()));
705 } 704 }
706 } 705 }
707 } 706 }
708 707
709 if (cursor_.get()) 708 if (cursor_.get())
710 *cursor_info = *cursor_; 709 *cursor_info = *cursor_;
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } 1046 }
1048 1047
1049 void PluginInstance::SendDidChangeView(const ViewData& previous_view) { 1048 void PluginInstance::SendDidChangeView(const ViewData& previous_view) {
1050 if (suppress_did_change_view_ || 1049 if (suppress_did_change_view_ ||
1051 (sent_initial_did_change_view_ && previous_view.Equals(view_data_))) 1050 (sent_initial_did_change_view_ && previous_view.Equals(view_data_)))
1052 return; // Nothing to update. 1051 return; // Nothing to update.
1053 1052
1054 sent_initial_did_change_view_ = true; 1053 sent_initial_did_change_view_ = true;
1055 ScopedPPResource resource( 1054 ScopedPPResource resource(
1056 ScopedPPResource::PassRef(), 1055 ScopedPPResource::PassRef(),
1057 (new PPB_View_Shared(PPB_View_Shared::InitAsImpl(), 1056 (new PPB_View_Shared(::ppapi::OBJECT_IS_IMPL,
1058 pp_instance(), view_data_))->GetReference()); 1057 pp_instance(), view_data_))->GetReference());
1059 1058
1060 instance_interface_->DidChangeView(pp_instance(), resource, 1059 instance_interface_->DidChangeView(pp_instance(), resource,
1061 &view_data_.rect, 1060 &view_data_.rect,
1062 &view_data_.clip_rect); 1061 &view_data_.clip_rect);
1063 } 1062 }
1064 1063
1065 void PluginInstance::ReportGeometry() { 1064 void PluginInstance::ReportGeometry() {
1066 // If this call was delayed, we may have transitioned back to fullscreen in 1065 // If this call was delayed, we may have transitioned back to fullscreen in
1067 // the mean time, so only report the geometry if we are actually in normal 1066 // the mean time, so only report the geometry if we are actually in normal
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 screen_size_for_fullscreen_ = gfx::Size(); 2087 screen_size_for_fullscreen_ = gfx::Size();
2089 WebElement element = container_->element(); 2088 WebElement element = container_->element();
2090 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2089 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2091 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2090 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2092 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2091 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2093 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2092 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2094 } 2093 }
2095 2094
2096 } // namespace ppapi 2095 } // namespace ppapi
2097 } // namespace webkit 2096 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698