| 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 // Implementation of ChromeActiveDocument | 5 // Implementation of ChromeActiveDocument |
| 6 #include "chrome_frame/chrome_active_document.h" | 6 #include "chrome_frame/chrome_active_document.h" |
| 7 | 7 |
| 8 #include <hlink.h> | 8 #include <hlink.h> |
| 9 #include <htiface.h> | 9 #include <htiface.h> |
| 10 #include <initguid.h> | 10 #include <initguid.h> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "base/process_util.h" | 23 #include "base/process_util.h" |
| 24 #include "base/registry.h" | 24 #include "base/registry.h" |
| 25 #include "base/scoped_variant_win.h" | 25 #include "base/scoped_variant_win.h" |
| 26 #include "base/string_tokenizer.h" | 26 #include "base/string_tokenizer.h" |
| 27 #include "base/string_util.h" | 27 #include "base/string_util.h" |
| 28 #include "base/thread.h" | 28 #include "base/thread.h" |
| 29 #include "base/thread_local.h" | 29 #include "base/thread_local.h" |
| 30 #include "base/trace_event.h" | 30 #include "base/trace_event.h" |
| 31 | 31 |
| 32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| 33 #include "chrome/app/chrome_dll_resource.h" |
| 33 #include "chrome/browser/tab_contents/tab_contents.h" | 34 #include "chrome/browser/tab_contents/tab_contents.h" |
| 34 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
| 35 #include "chrome/common/navigation_types.h" | 36 #include "chrome/common/navigation_types.h" |
| 36 #include "chrome/test/automation/browser_proxy.h" | 37 #include "chrome/test/automation/browser_proxy.h" |
| 37 #include "chrome/test/automation/tab_proxy.h" | 38 #include "chrome/test/automation/tab_proxy.h" |
| 38 #include "chrome_frame/bho.h" | 39 #include "chrome_frame/bho.h" |
| 39 #include "chrome_frame/bind_context_info.h" | 40 #include "chrome_frame/bind_context_info.h" |
| 40 #include "chrome_frame/chrome_imported_resources.h" | |
| 41 #include "chrome_frame/utils.h" | 41 #include "chrome_frame/utils.h" |
| 42 | 42 |
| 43 const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab"; | 43 const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab"; |
| 44 | 44 |
| 45 static const wchar_t kUseChromeNetworking[] = L"UseChromeNetworking"; | 45 static const wchar_t kUseChromeNetworking[] = L"UseChromeNetworking"; |
| 46 static const wchar_t kHandleTopLevelRequests[] = L"HandleTopLevelRequests"; | 46 static const wchar_t kHandleTopLevelRequests[] = L"HandleTopLevelRequests"; |
| 47 | 47 |
| 48 DEFINE_GUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, | 48 DEFINE_GUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0, 0xC0, 0, 0, 0, 0, 0, 0, |
| 49 0x46); | 49 0x46); |
| 50 | 50 |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 866 |
| 867 // Call base class (adds 'About' item) | 867 // Call base class (adds 'About' item) |
| 868 return BaseActiveX::PreProcessContextMenu(menu); | 868 return BaseActiveX::PreProcessContextMenu(menu); |
| 869 } | 869 } |
| 870 | 870 |
| 871 bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd, | 871 bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd, |
| 872 const IPC::ContextMenuParams& params) { | 872 const IPC::ContextMenuParams& params) { |
| 873 ScopedComPtr<IWebBrowser2> web_browser2; | 873 ScopedComPtr<IWebBrowser2> web_browser2; |
| 874 DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); | 874 DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); |
| 875 | 875 |
| 876 if (cmd == static_cast<UINT>(context_menu_IDC_BACK)) { | 876 if (cmd == IDC_BACK) |
| 877 web_browser2->GoBack(); | 877 web_browser2->GoBack(); |
| 878 } else if (cmd == static_cast<UINT>(context_menu_IDC_FORWARD)) { | 878 else if (cmd == IDC_FORWARD) |
| 879 web_browser2->GoForward(); | 879 web_browser2->GoForward(); |
| 880 } else if (cmd == static_cast<UINT>(context_menu_IDC_RELOAD)) { | 880 else if (cmd == IDC_RELOAD) |
| 881 web_browser2->Refresh(); | 881 web_browser2->Refresh(); |
| 882 } else { | 882 else |
| 883 return BaseActiveX::HandleContextMenuCommand(cmd, params); | 883 return BaseActiveX::HandleContextMenuCommand(cmd, params); |
| 884 } | |
| 885 | 884 |
| 886 return true; | 885 return true; |
| 887 } | 886 } |
| 888 | 887 |
| 889 HRESULT ChromeActiveDocument::IEExec(const GUID* cmd_group_guid, | 888 HRESULT ChromeActiveDocument::IEExec(const GUID* cmd_group_guid, |
| 890 DWORD command_id, DWORD cmd_exec_opt, | 889 DWORD command_id, DWORD cmd_exec_opt, |
| 891 VARIANT* in_args, VARIANT* out_args) { | 890 VARIANT* in_args, VARIANT* out_args) { |
| 892 HRESULT hr = E_FAIL; | 891 HRESULT hr = E_FAIL; |
| 893 | 892 |
| 894 ScopedComPtr<IOleCommandTarget> frame_cmd_target; | 893 ScopedComPtr<IOleCommandTarget> frame_cmd_target; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 ScopedComPtr<ITridentService2> trident_services; | 1245 ScopedComPtr<ITridentService2> trident_services; |
| 1247 trident_services.QueryFrom(shell_browser); | 1246 trident_services.QueryFrom(shell_browser); |
| 1248 if (trident_services) { | 1247 if (trident_services) { |
| 1249 trident_services->FirePrivacyImpactedStateChange(wparam); | 1248 trident_services->FirePrivacyImpactedStateChange(wparam); |
| 1250 } else { | 1249 } else { |
| 1251 NOTREACHED() << "Failed to retrieve IWebBrowser2 interface."; | 1250 NOTREACHED() << "Failed to retrieve IWebBrowser2 interface."; |
| 1252 } | 1251 } |
| 1253 return 0; | 1252 return 0; |
| 1254 } | 1253 } |
| 1255 | 1254 |
| OLD | NEW |