| 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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 return browser_plugin_manager_; | 222 return browser_plugin_manager_; |
| 223 } | 223 } |
| 224 | 224 |
| 225 // Virtual to allow for mocking in tests. | 225 // Virtual to allow for mocking in tests. |
| 226 virtual float GetDeviceScaleFactor() const; | 226 virtual float GetDeviceScaleFactor() const; |
| 227 | 227 |
| 228 // Parses the attributes of the browser plugin from the element's attributes | 228 // Parses the attributes of the browser plugin from the element's attributes |
| 229 // and sets them appropriately. | 229 // and sets them appropriately. |
| 230 void ParseAttributes(const WebKit::WebPluginParams& params); | 230 void ParseAttributes(const WebKit::WebPluginParams& params); |
| 231 | 231 |
| 232 // Initializes the valid events. | |
| 233 void InitializeEvents(); | |
| 234 | |
| 235 // Cleanup event listener state to free v8 resources when a BrowserPlugin | |
| 236 // is destroyed. | |
| 237 void RemoveEventListeners(); | |
| 238 | |
| 239 // Returns whether |event_name| is a valid event. | |
| 240 bool IsValidEvent(const std::string& event_name); | |
| 241 | |
| 242 // Triggers the event-listeners for |event_name|. Note that the function | 232 // Triggers the event-listeners for |event_name|. Note that the function |
| 243 // frees all the values in |props|. | 233 // frees all the values in |props|. |
| 244 void TriggerEvent(const std::string& event_name, | 234 void TriggerEvent(const std::string& event_name, |
| 245 std::map<std::string, base::Value*>* props); | 235 std::map<std::string, base::Value*>* props); |
| 246 | 236 |
| 247 // Creates and maps transport dib. Overridden in tests. | 237 // Creates and maps transport dib. Overridden in tests. |
| 248 virtual TransportDIB* CreateTransportDIB(const size_t size); | 238 virtual TransportDIB* CreateTransportDIB(const size_t size); |
| 249 // Frees up the damage buffer. Overridden in tests. | 239 // Frees up the damage buffer. Overridden in tests. |
| 250 virtual void FreeDamageBuffer(TransportDIB** damage_buffer); | 240 virtual void FreeDamageBuffer(TransportDIB** damage_buffer); |
| 251 // Swaps out the |current_damage_buffer_| with the |pending_damage_buffer_|. | 241 // Swaps out the |current_damage_buffer_| with the |pending_damage_buffer_|. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // the changes are not always obvious. For example, there is a maximum | 328 // the changes are not always obvious. For example, there is a maximum |
| 339 // number of entries and earlier ones will automatically be pruned. | 329 // number of entries and earlier ones will automatically be pruned. |
| 340 int current_nav_entry_index_; | 330 int current_nav_entry_index_; |
| 341 int nav_entry_count_; | 331 int nav_entry_count_; |
| 342 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 332 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 343 }; | 333 }; |
| 344 | 334 |
| 345 } // namespace content | 335 } // namespace content |
| 346 | 336 |
| 347 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 337 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |