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 13 matching lines...) Expand all Loading... |
24 #include "base/path_service.h" | 24 #include "base/path_service.h" |
25 #include "base/process_util.h" | 25 #include "base/process_util.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/utf_string_conversions.h" | 30 #include "base/utf_string_conversions.h" |
31 #include "base/win/scoped_variant.h" | 31 #include "base/win/scoped_variant.h" |
32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
33 #include "chrome/app/chrome_dll_resource.h" | 33 #include "chrome/app/chrome_dll_resource.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/common/page_zoom.h" | 37 #include "chrome/common/page_zoom.h" |
37 #include "chrome/test/automation/browser_proxy.h" | 38 #include "chrome/test/automation/browser_proxy.h" |
38 #include "chrome/test/automation/tab_proxy.h" | 39 #include "chrome/test/automation/tab_proxy.h" |
39 #include "chrome_frame/bho.h" | 40 #include "chrome_frame/bho.h" |
40 #include "chrome_frame/bind_context_info.h" | 41 #include "chrome_frame/bind_context_info.h" |
41 #include "chrome_frame/buggy_bho_handling.h" | 42 #include "chrome_frame/buggy_bho_handling.h" |
42 #include "chrome_frame/crash_reporting/crash_metrics.h" | 43 #include "chrome_frame/crash_reporting/crash_metrics.h" |
43 #include "chrome_frame/utils.h" | 44 #include "chrome_frame/utils.h" |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 MF_ENABLED : MF_DISABLED)); | 963 MF_ENABLED : MF_DISABLED)); |
963 EnableMenuItem(menu, IDS_CONTENT_CONTEXT_FORWARD, MF_BYCOMMAND | | 964 EnableMenuItem(menu, IDS_CONTENT_CONTEXT_FORWARD, MF_BYCOMMAND | |
964 (SUCCEEDED(travel_log->GetTravelEntry(browser_service, TLOG_FORE, NULL)) ? | 965 (SUCCEEDED(travel_log->GetTravelEntry(browser_service, TLOG_FORE, NULL)) ? |
965 MF_ENABLED : MF_DISABLED)); | 966 MF_ENABLED : MF_DISABLED)); |
966 | 967 |
967 // Call base class (adds 'About' item) | 968 // Call base class (adds 'About' item) |
968 return BaseActiveX::PreProcessContextMenu(menu); | 969 return BaseActiveX::PreProcessContextMenu(menu); |
969 } | 970 } |
970 | 971 |
971 bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd, | 972 bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd, |
972 const IPC::MiniContextMenuParams& params) { | 973 const IPC::ContextMenuParams& params) { |
973 ScopedComPtr<IWebBrowser2> web_browser2; | 974 ScopedComPtr<IWebBrowser2> web_browser2; |
974 DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); | 975 DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); |
975 | 976 |
976 if (cmd == IDC_BACK) | 977 if (cmd == IDC_BACK) |
977 web_browser2->GoBack(); | 978 web_browser2->GoBack(); |
978 else if (cmd == IDC_FORWARD) | 979 else if (cmd == IDC_FORWARD) |
979 web_browser2->GoForward(); | 980 web_browser2->GoForward(); |
980 else if (cmd == IDC_RELOAD) | 981 else if (cmd == IDC_RELOAD) |
981 web_browser2->Refresh(); | 982 web_browser2->Refresh(); |
982 else | 983 else |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 | 1331 |
1331 if (new_navigation_info.url != navigation_info_.url) | 1332 if (new_navigation_info.url != navigation_info_.url) |
1332 return true; | 1333 return true; |
1333 | 1334 |
1334 if (new_navigation_info.referrer != navigation_info_.referrer) | 1335 if (new_navigation_info.referrer != navigation_info_.referrer) |
1335 return true; | 1336 return true; |
1336 | 1337 |
1337 return false; | 1338 return false; |
1338 } | 1339 } |
1339 | 1340 |
OLD | NEW |