| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_FRAME_CHROME_FRAME_NPAPI_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_NPAPI_H_ |
| 6 #define CHROME_FRAME_CHROME_FRAME_NPAPI_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_NPAPI_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlwin.h> | 9 #include <atlwin.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 // Implementation of SetProperty, public to allow unittesting. | 123 // Implementation of SetProperty, public to allow unittesting. |
| 124 bool SetProperty(NPIdentifier name, const NPVariant *variant); | 124 bool SetProperty(NPIdentifier name, const NPVariant *variant); |
| 125 // Implementation of GetProperty, public to allow unittesting. | 125 // Implementation of GetProperty, public to allow unittesting. |
| 126 bool GetProperty(NPIdentifier name, NPVariant *variant); | 126 bool GetProperty(NPIdentifier name, NPVariant *variant); |
| 127 | 127 |
| 128 // Initialize string->identifier mapping, public to allow unittesting. | 128 // Initialize string->identifier mapping, public to allow unittesting. |
| 129 static void InitializeIdentifiers(); | 129 static void InitializeIdentifiers(); |
| 130 | 130 |
| 131 bool PreProcessContextMenu(HMENU menu); | 131 bool PreProcessContextMenu(HMENU menu); |
| 132 bool HandleContextMenuCommand(UINT cmd, | 132 bool HandleContextMenuCommand(UINT cmd, const MiniContextMenuParams& params); |
| 133 const IPC::MiniContextMenuParams& params); | |
| 134 protected: | 133 protected: |
| 135 // Handler for accelerator messages passed on from the hosted chrome | 134 // Handler for accelerator messages passed on from the hosted chrome |
| 136 // instance. | 135 // instance. |
| 137 virtual void OnAcceleratorPressed(int tab_handle, const MSG& accel_message); | 136 virtual void OnAcceleratorPressed(int tab_handle, const MSG& accel_message); |
| 138 virtual void OnTabbedOut(int tab_handle, bool reverse); | 137 virtual void OnTabbedOut(int tab_handle, bool reverse); |
| 139 virtual void OnOpenURL(int tab_handle, const GURL& url, | 138 virtual void OnOpenURL(int tab_handle, const GURL& url, |
| 140 const GURL& referrer, int open_disposition); | 139 const GURL& referrer, int open_disposition); |
| 141 virtual void OnLoad(int tab_handle, const GURL& url); | 140 virtual void OnLoad(int tab_handle, const GURL& url); |
| 142 virtual void OnMessageFromChromeFrame(int tab_handle, | 141 virtual void OnMessageFromChromeFrame(int tab_handle, |
| 143 const std::string& message, | 142 const std::string& message, |
| 144 const std::string& origin, | 143 const std::string& origin, |
| 145 const std::string& target); | 144 const std::string& target); |
| 146 // ChromeFrameDelegate overrides | 145 // ChromeFrameDelegate overrides |
| 147 virtual void OnLoadFailed(int error_code, const std::string& url); | 146 virtual void OnLoadFailed(int error_code, const std::string& url); |
| 148 virtual void OnAutomationServerReady(); | 147 virtual void OnAutomationServerReady(); |
| 149 virtual void OnAutomationServerLaunchFailed( | 148 virtual void OnAutomationServerLaunchFailed( |
| 150 AutomationLaunchResult reason, const std::string& server_version); | 149 AutomationLaunchResult reason, const std::string& server_version); |
| 151 virtual void OnExtensionInstalled(const FilePath& path, | 150 virtual void OnExtensionInstalled(const FilePath& path, |
| 152 void* user_data, AutomationMsg_ExtensionResponseValues response); | 151 void* user_data, AutomationMsg_ExtensionResponseValues response); |
| 153 virtual void OnGetEnabledExtensionsComplete( | 152 virtual void OnGetEnabledExtensionsComplete( |
| 154 void* user_data, | 153 void* user_data, |
| 155 const std::vector<FilePath>& extension_directories); | 154 const std::vector<FilePath>& extension_directories); |
| 156 virtual void OnCloseTab(int tab_handle); | 155 virtual void OnCloseTab(); |
| 157 | 156 |
| 158 private: | 157 private: |
| 159 void SubscribeToFocusEvents(); | 158 void SubscribeToFocusEvents(); |
| 160 void UnsubscribeFromFocusEvents(); | 159 void UnsubscribeFromFocusEvents(); |
| 161 | 160 |
| 162 // Equivalent of: | 161 // Equivalent of: |
| 163 // event = window.document.createEvent("Event"); | 162 // event = window.document.createEvent("Event"); |
| 164 // event.initEvent(type, bubbles, cancelable); | 163 // event.initEvent(type, bubbles, cancelable); |
| 165 // and then returns the event object. | 164 // and then returns the event object. |
| 166 bool CreateEvent(const std::string& type, bool bubbles, bool cancelable, | 165 bool CreateEvent(const std::string& type, bool bubbles, bool cancelable, |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // The value of src property keeping the current URL. | 345 // The value of src property keeping the current URL. |
| 347 std::string src_; | 346 std::string src_; |
| 348 // Used to fetch network resources when host network stack is in use. | 347 // Used to fetch network resources when host network stack is in use. |
| 349 NPAPIUrlRequestManager url_fetcher_; | 348 NPAPIUrlRequestManager url_fetcher_; |
| 350 | 349 |
| 351 // Set if we receive a navigation request before initializing Chrome. | 350 // Set if we receive a navigation request before initializing Chrome. |
| 352 bool navigate_after_initialization_; | 351 bool navigate_after_initialization_; |
| 353 }; | 352 }; |
| 354 | 353 |
| 355 #endif // CHROME_FRAME_CHROME_FRAME_NPAPI_H_ | 354 #endif // CHROME_FRAME_CHROME_FRAME_NPAPI_H_ |
| OLD | NEW |