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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 virtual bool IsValid() const { | 107 virtual bool IsValid() const { |
108 return automation_client_.get() != NULL; | 108 return automation_client_.get() != NULL; |
109 } | 109 } |
110 | 110 |
111 virtual void OnHostMoved() { | 111 virtual void OnHostMoved() { |
112 if (IsValid()) | 112 if (IsValid()) |
113 automation_client_->OnChromeFrameHostMoved(); | 113 automation_client_->OnChromeFrameHostMoved(); |
114 } | 114 } |
115 | 115 |
116 protected: | 116 protected: |
117 virtual void OnNavigationFailed(int tab_handle, int error_code, | 117 virtual void OnNavigationFailed(int error_code, const GURL& gurl) { |
118 const GURL& gurl) { | |
119 OnLoadFailed(error_code, gurl.spec()); | 118 OnLoadFailed(error_code, gurl.spec()); |
120 } | 119 } |
121 | 120 |
122 virtual void OnHandleContextMenu(int tab_handle, HANDLE menu_handle, | 121 virtual void OnHandleContextMenu(HANDLE menu_handle, |
123 int align_flags, | 122 int align_flags, |
124 const IPC::MiniContextMenuParams& params) { | 123 const MiniContextMenuParams& params) { |
125 if (!menu_handle || !automation_client_.get()) { | 124 if (!menu_handle || !automation_client_.get()) { |
126 NOTREACHED(); | 125 NOTREACHED(); |
127 return; | 126 return; |
128 } | 127 } |
129 | 128 |
130 // TrackPopupMenuEx call will fail on IE on Vista running | 129 // TrackPopupMenuEx call will fail on IE on Vista running |
131 // 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 |
132 // though, so just clone it and show the copy: | 131 // though, so just clone it and show the copy: |
133 HMENU copy = UtilCloneContextMenu(static_cast<HMENU>(menu_handle)); | 132 HMENU copy = UtilCloneContextMenu(static_cast<HMENU>(menu_handle)); |
134 if (!copy) | 133 if (!copy) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 bool PreProcessContextMenu(HMENU menu) { | 212 bool PreProcessContextMenu(HMENU menu) { |
214 // Add an "About" item. | 213 // Add an "About" item. |
215 AppendMenu(menu, MF_STRING, IDC_ABOUT_CHROME_FRAME, | 214 AppendMenu(menu, MF_STRING, IDC_ABOUT_CHROME_FRAME, |
216 SimpleResourceLoader::Get(IDS_CHROME_FRAME_MENU_ABOUT).c_str()); | 215 SimpleResourceLoader::Get(IDS_CHROME_FRAME_MENU_ABOUT).c_str()); |
217 return true; | 216 return true; |
218 } | 217 } |
219 | 218 |
220 // 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 |
221 // 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. |
222 bool HandleContextMenuCommand(UINT cmd, | 221 bool HandleContextMenuCommand(UINT cmd, |
223 const IPC::MiniContextMenuParams& params) { | 222 const MiniContextMenuParams& params) { |
224 return false; | 223 return false; |
225 } | 224 } |
226 | 225 |
227 // Allow overriding the type of automation client used, for unit tests. | 226 // Allow overriding the type of automation client used, for unit tests. |
228 virtual ChromeFrameAutomationClient* CreateAutomationClient() { | 227 virtual ChromeFrameAutomationClient* CreateAutomationClient() { |
229 return new ChromeFrameAutomationClient; | 228 return new ChromeFrameAutomationClient; |
230 } | 229 } |
231 | 230 |
232 void GiveFocusToChrome(bool restore_focus_to_view) { | 231 void GiveFocusToChrome(bool restore_focus_to_view) { |
233 if (IsValid()) { | 232 if (IsValid()) { |
(...skipping 29 matching lines...) Expand all Loading... |
263 bool ignore_setfocus_; | 262 bool ignore_setfocus_; |
264 | 263 |
265 // List of functions to enable for automation, or a single entry "*" to | 264 // List of functions to enable for automation, or a single entry "*" to |
266 // enable all functions for automation. Ignored unless is_privileged_ is | 265 // enable all functions for automation. Ignored unless is_privileged_ is |
267 // true. Defaults to the empty list, meaning automation will not be | 266 // true. Defaults to the empty list, meaning automation will not be |
268 // turned on. | 267 // turned on. |
269 std::vector<std::string> functions_enabled_; | 268 std::vector<std::string> functions_enabled_; |
270 }; | 269 }; |
271 | 270 |
272 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 271 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
OLD | NEW |