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

Side by Side Diff: ppapi/cpp/instance.h

Issue 10694026: Plumb through the page focus lost event to Pepper plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « ppapi/c/ppp_instance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef PPAPI_CPP_INSTANCE_H_ 5 #ifndef PPAPI_CPP_INSTANCE_H_
6 #define PPAPI_CPP_INSTANCE_H_ 6 #define PPAPI_CPP_INSTANCE_H_
7 7
8 /// @file 8 /// @file
9 /// This file defines the C++ wrapper for an instance. 9 /// This file defines the C++ wrapper for an instance.
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 /// entire region. The time saved doing partial paints is usually not 134 /// entire region. The time saved doing partial paints is usually not
135 /// significant and it can create artifacts when scrolling (this notification 135 /// significant and it can create artifacts when scrolling (this notification
136 /// is sent asynchronously from scolling so there can be flashes of old 136 /// is sent asynchronously from scolling so there can be flashes of old
137 /// content in the exposed regions). 137 /// content in the exposed regions).
138 virtual void DidChangeView(const Rect& position, const Rect& clip); 138 virtual void DidChangeView(const Rect& position, const Rect& clip);
139 139
140 /// DidChangeFocus() is called when an instance has gained or lost focus. 140 /// DidChangeFocus() is called when an instance has gained or lost focus.
141 /// Having focus means that keyboard events will be sent to the instance. 141 /// Having focus means that keyboard events will be sent to the instance.
142 /// An instance's default condition is that it will not have focus. 142 /// An instance's default condition is that it will not have focus.
143 /// 143 ///
144 /// The focus flag takes into account both browser tab and window focus as
145 /// well as focus of the plugin element on the page. In order to be deemed
146 /// to have focus, the browser window must be topmost, the tab must be
147 /// selected in the window, and the instance must be the focused element on
148 /// the page.
149 ///
144 /// <strong>Note:</strong>Clicks on instances will give focus only if you 150 /// <strong>Note:</strong>Clicks on instances will give focus only if you
145 /// handle the click event. Return <code>true</code> from HandleInputEvent to 151 /// handle the click event. Return <code>true</code> from
146 /// signal that the click event was handled. Otherwise the browser will bubble 152 /// <code>HandleInputEvent</code> in <code>PPP_InputEvent</code> (or use
147 /// the event and give focus to the element on the page that actually did end 153 /// unfiltered events) to signal that the click event was handled. Otherwise,
148 /// up consuming it. If you're not getting focus, check to make sure you're 154 /// the browser will bubble the event and give focus to the element on the
149 /// returning true from the mouse click in <code>HandleInputEvent</code>. 155 /// page that actually did end up consuming it. If you're not getting focus,
156 /// check to make sure you're either requesting them via
157 /// <code>RequestInputEvents()<code> (which implicitly marks all input events
158 /// as consumed) or via <code>RequestFilteringInputEvents()</code> and
159 /// returning true from your event handler.
150 /// 160 ///
151 /// @param[in] has_focus Indicates the new focused state of the instance. 161 /// @param[in] has_focus Indicates the new focused state of the instance.
152 virtual void DidChangeFocus(bool has_focus); 162 virtual void DidChangeFocus(bool has_focus);
153 163
154 /// HandleInputEvent() handles input events from the browser. The default 164 /// HandleInputEvent() handles input events from the browser. The default
155 /// implementation does nothing and returns false. 165 /// implementation does nothing and returns false.
156 /// 166 ///
157 /// In order to receive input events, you must register for them by calling 167 /// In order to receive input events, you must register for them by calling
158 /// RequestInputEvents() or RequestFilteringInputEvents(). By 168 /// RequestInputEvents() or RequestFilteringInputEvents(). By
159 /// default, no events are delivered. 169 /// default, no events are delivered.
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 private: 528 private:
519 PP_Instance pp_instance_; 529 PP_Instance pp_instance_;
520 530
521 typedef std::map<std::string, void*> InterfaceNameToObjectMap; 531 typedef std::map<std::string, void*> InterfaceNameToObjectMap;
522 InterfaceNameToObjectMap interface_name_to_objects_; 532 InterfaceNameToObjectMap interface_name_to_objects_;
523 }; 533 };
524 534
525 } // namespace pp 535 } // namespace pp
526 536
527 #endif // PPAPI_CPP_INSTANCE_H_ 537 #endif // PPAPI_CPP_INSTANCE_H_
OLDNEW
« no previous file with comments | « ppapi/c/ppp_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698