OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PLUGIN_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
6 #define CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 protected: | 115 protected: |
116 virtual void OnNavigationFailed(int tab_handle, int error_code, | 116 virtual void OnNavigationFailed(int tab_handle, int error_code, |
117 const GURL& gurl) { | 117 const GURL& gurl) { |
118 OnLoadFailed(error_code, gurl.spec()); | 118 OnLoadFailed(error_code, gurl.spec()); |
119 } | 119 } |
120 | 120 |
121 virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle, | 121 virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle, |
122 int align_flags, | 122 int align_flags, |
123 const IPC::MiniContextMenuParams& params) { | 123 const IPC::ContextMenuParams& params) { |
124 if (!menu_handle || !automation_client_.get()) { | 124 if (!menu_handle || !automation_client_.get()) { |
125 NOTREACHED(); | 125 NOTREACHED(); |
126 return; | 126 return; |
127 } | 127 } |
128 | 128 |
129 // TrackPopupMenuEx call will fail on IE on Vista running | 129 // TrackPopupMenuEx call will fail on IE on Vista running |
130 // in low integrity mode. We DO seem to be able to enumerate the menu | 130 // in low integrity mode. We DO seem to be able to enumerate the menu |
131 // though, so just clone it and show the copy: | 131 // though, so just clone it and show the copy: |
132 HMENU copy = UtilCloneContextMenu(static_cast<HMENU>(menu_handle)); | 132 HMENU copy = UtilCloneContextMenu(static_cast<HMENU>(menu_handle)); |
133 if (!copy) | 133 if (!copy) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bool PreProcessContextMenu(HMENU menu) { | 212 bool PreProcessContextMenu(HMENU menu) { |
213 // Add an "About" item. | 213 // Add an "About" item. |
214 AppendMenu(menu, MF_STRING, IDC_ABOUT_CHROME_FRAME, | 214 AppendMenu(menu, MF_STRING, IDC_ABOUT_CHROME_FRAME, |
215 SimpleResourceLoader::Get(IDS_CHROME_FRAME_MENU_ABOUT).c_str()); | 215 SimpleResourceLoader::Get(IDS_CHROME_FRAME_MENU_ABOUT).c_str()); |
216 return true; | 216 return true; |
217 } | 217 } |
218 | 218 |
219 // Return true if menu command is processed, otherwise the command will be | 219 // Return true if menu command is processed, otherwise the command will be |
220 // passed to Chrome for execution. Override in most-derived class if needed. | 220 // passed to Chrome for execution. Override in most-derived class if needed. |
221 bool HandleContextMenuCommand(UINT cmd, | 221 bool HandleContextMenuCommand(UINT cmd, |
222 const IPC::MiniContextMenuParams& params) { | 222 const IPC::ContextMenuParams& params) { |
223 return false; | 223 return false; |
224 } | 224 } |
225 | 225 |
226 // Allow overriding the type of automation client used, for unit tests. | 226 // Allow overriding the type of automation client used, for unit tests. |
227 virtual ChromeFrameAutomationClient* CreateAutomationClient() { | 227 virtual ChromeFrameAutomationClient* CreateAutomationClient() { |
228 return new ChromeFrameAutomationClient; | 228 return new ChromeFrameAutomationClient; |
229 } | 229 } |
230 | 230 |
231 void GiveFocusToChrome(bool restore_focus_to_view) { | 231 void GiveFocusToChrome(bool restore_focus_to_view) { |
232 if (IsValid()) { | 232 if (IsValid()) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 // List of functions to enable for automation, or a single entry "*" to | 272 // List of functions to enable for automation, or a single entry "*" to |
273 // enable all functions for automation. Ignored unless is_privileged_ is | 273 // enable all functions for automation. Ignored unless is_privileged_ is |
274 // true. Defaults to the empty list, meaning automation will not be | 274 // true. Defaults to the empty list, meaning automation will not be |
275 // turned on. | 275 // turned on. |
276 std::vector<std::string> functions_enabled_; | 276 std::vector<std::string> functions_enabled_; |
277 }; | 277 }; |
278 | 278 |
279 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 279 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
280 | 280 |
OLD | NEW |