| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 HRESULT ChromeActiveDocument::FinalConstruct() { | 71 HRESULT ChromeActiveDocument::FinalConstruct() { |
| 72 // If we have a cached ChromeActiveDocument instance in TLS, then grab | 72 // If we have a cached ChromeActiveDocument instance in TLS, then grab |
| 73 // ownership of the cached document's automation client. This is an | 73 // ownership of the cached document's automation client. This is an |
| 74 // optimization to get Chrome active documents to load faster. | 74 // optimization to get Chrome active documents to load faster. |
| 75 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); | 75 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); |
| 76 if (cached_document && cached_document->IsValid()) { | 76 if (cached_document && cached_document->IsValid()) { |
| 77 DCHECK(automation_client_.get() == NULL); | 77 DCHECK(automation_client_.get() == NULL); |
| 78 automation_client_.swap(cached_document->automation_client_); | 78 automation_client_.swap(cached_document->automation_client_); |
| 79 DLOG(INFO) << "Reusing automation client instance from " | 79 DVLOG(1) << "Reusing automation client instance from " << cached_document; |
| 80 << cached_document; | |
| 81 DCHECK(automation_client_.get() != NULL); | 80 DCHECK(automation_client_.get() != NULL); |
| 82 automation_client_->Reinitialize(this, url_fetcher_.get()); | 81 automation_client_->Reinitialize(this, url_fetcher_.get()); |
| 83 is_automation_client_reused_ = true; | 82 is_automation_client_reused_ = true; |
| 84 OnAutomationServerReady(); | 83 OnAutomationServerReady(); |
| 85 } else { | 84 } else { |
| 86 // The FinalConstruct implementation in the ChromeFrameActivexBase class | 85 // The FinalConstruct implementation in the ChromeFrameActivexBase class |
| 87 // i.e. Base creates an instance of the ChromeFrameAutomationClient class | 86 // i.e. Base creates an instance of the ChromeFrameAutomationClient class |
| 88 // and initializes it, which would spawn a new Chrome process, etc. | 87 // and initializes it, which would spawn a new Chrome process, etc. |
| 89 // We don't want to be doing this if we have a cached document, whose | 88 // We don't want to be doing this if we have a cached document, whose |
| 90 // automation client instance can be reused. | 89 // automation client instance can be reused. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 115 | 114 |
| 116 HMODULE this_module = reinterpret_cast<HMODULE>(&__ImageBase); | 115 HMODULE this_module = reinterpret_cast<HMODULE>(&__ImageBase); |
| 117 accelerator_table_ = | 116 accelerator_table_ = |
| 118 LoadAccelerators(this_module, | 117 LoadAccelerators(this_module, |
| 119 MAKEINTRESOURCE(IDR_CHROME_FRAME_IE_FULL_TAB)); | 118 MAKEINTRESOURCE(IDR_CHROME_FRAME_IE_FULL_TAB)); |
| 120 DCHECK(accelerator_table_ != NULL); | 119 DCHECK(accelerator_table_ != NULL); |
| 121 return S_OK; | 120 return S_OK; |
| 122 } | 121 } |
| 123 | 122 |
| 124 ChromeActiveDocument::~ChromeActiveDocument() { | 123 ChromeActiveDocument::~ChromeActiveDocument() { |
| 125 DLOG(INFO) << __FUNCTION__; | 124 DVLOG(1) << __FUNCTION__; |
| 126 if (find_dialog_.IsWindow()) | 125 if (find_dialog_.IsWindow()) |
| 127 find_dialog_.DestroyWindow(); | 126 find_dialog_.DestroyWindow(); |
| 128 // ChromeFramePlugin | 127 // ChromeFramePlugin |
| 129 BaseActiveX::Uninitialize(); | 128 BaseActiveX::Uninitialize(); |
| 130 | 129 |
| 131 TRACE_EVENT_END("chromeframe.createactivedocument", this, ""); | 130 TRACE_EVENT_END("chromeframe.createactivedocument", this, ""); |
| 132 } | 131 } |
| 133 | 132 |
| 134 // Override DoVerb | 133 // Override DoVerb |
| 135 STDMETHODIMP ChromeActiveDocument::DoVerb(LONG verb, | 134 STDMETHODIMP ChromeActiveDocument::DoVerb(LONG verb, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 return IOleObjectImpl<ChromeActiveDocument>::DoVerb(verb, | 163 return IOleObjectImpl<ChromeActiveDocument>::DoVerb(verb, |
| 165 msg, | 164 msg, |
| 166 active_site, | 165 active_site, |
| 167 index, | 166 index, |
| 168 parent_window, | 167 parent_window, |
| 169 pos); | 168 pos); |
| 170 } | 169 } |
| 171 | 170 |
| 172 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate | 171 // Override IOleInPlaceActiveObjectImpl::OnDocWindowActivate |
| 173 STDMETHODIMP ChromeActiveDocument::OnDocWindowActivate(BOOL activate) { | 172 STDMETHODIMP ChromeActiveDocument::OnDocWindowActivate(BOOL activate) { |
| 174 DLOG(INFO) << __FUNCTION__; | 173 DVLOG(1) << __FUNCTION__; |
| 175 return S_OK; | 174 return S_OK; |
| 176 } | 175 } |
| 177 | 176 |
| 178 STDMETHODIMP ChromeActiveDocument::TranslateAccelerator(MSG* msg) { | 177 STDMETHODIMP ChromeActiveDocument::TranslateAccelerator(MSG* msg) { |
| 179 DLOG(INFO) << __FUNCTION__; | 178 DVLOG(1) << __FUNCTION__; |
| 180 if (msg == NULL) | 179 if (msg == NULL) |
| 181 return E_POINTER; | 180 return E_POINTER; |
| 182 | 181 |
| 183 if (msg->message == WM_KEYDOWN && msg->wParam == VK_TAB) { | 182 if (msg->message == WM_KEYDOWN && msg->wParam == VK_TAB) { |
| 184 HWND focus = ::GetFocus(); | 183 HWND focus = ::GetFocus(); |
| 185 if (focus != m_hWnd && !::IsChild(m_hWnd, focus)) { | 184 if (focus != m_hWnd && !::IsChild(m_hWnd, focus)) { |
| 186 // The call to SetFocus triggers a WM_SETFOCUS that makes the base class | 185 // The call to SetFocus triggers a WM_SETFOCUS that makes the base class |
| 187 // set focus to the correct element in Chrome. | 186 // set focus to the correct element in Chrome. |
| 188 ::SetFocus(m_hWnd); | 187 ::SetFocus(m_hWnd); |
| 189 return S_OK; | 188 return S_OK; |
| 190 } | 189 } |
| 191 } | 190 } |
| 192 | 191 |
| 193 return S_FALSE; | 192 return S_FALSE; |
| 194 } | 193 } |
| 195 // Override IPersistStorageImpl::IsDirty | 194 // Override IPersistStorageImpl::IsDirty |
| 196 STDMETHODIMP ChromeActiveDocument::IsDirty() { | 195 STDMETHODIMP ChromeActiveDocument::IsDirty() { |
| 197 DLOG(INFO) << __FUNCTION__; | 196 DVLOG(1) << __FUNCTION__; |
| 198 return S_FALSE; | 197 return S_FALSE; |
| 199 } | 198 } |
| 200 | 199 |
| 201 void ChromeActiveDocument::OnAutomationServerReady() { | 200 void ChromeActiveDocument::OnAutomationServerReady() { |
| 202 BaseActiveX::OnAutomationServerReady(); | 201 BaseActiveX::OnAutomationServerReady(); |
| 203 BaseActiveX::GiveFocusToChrome(true); | 202 BaseActiveX::GiveFocusToChrome(true); |
| 204 } | 203 } |
| 205 | 204 |
| 206 STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable, | 205 STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable, |
| 207 IMoniker* moniker_name, | 206 IMoniker* moniker_name, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if (NULL == class_id) | 322 if (NULL == class_id) |
| 324 return E_POINTER; | 323 return E_POINTER; |
| 325 *class_id = GetObjectCLSID(); | 324 *class_id = GetObjectCLSID(); |
| 326 return S_OK; | 325 return S_OK; |
| 327 } | 326 } |
| 328 | 327 |
| 329 STDMETHODIMP ChromeActiveDocument::QueryStatus(const GUID* cmd_group_guid, | 328 STDMETHODIMP ChromeActiveDocument::QueryStatus(const GUID* cmd_group_guid, |
| 330 ULONG number_of_commands, | 329 ULONG number_of_commands, |
| 331 OLECMD commands[], | 330 OLECMD commands[], |
| 332 OLECMDTEXT* command_text) { | 331 OLECMDTEXT* command_text) { |
| 333 DLOG(INFO) << __FUNCTION__; | 332 DVLOG(1) << __FUNCTION__; |
| 334 | 333 |
| 335 CommandStatusMap* command_map = NULL; | 334 CommandStatusMap* command_map = NULL; |
| 336 | 335 |
| 337 if (cmd_group_guid) { | 336 if (cmd_group_guid) { |
| 338 if (IsEqualGUID(*cmd_group_guid, GUID_NULL)) { | 337 if (IsEqualGUID(*cmd_group_guid, GUID_NULL)) { |
| 339 command_map = &null_group_commands_map_; | 338 command_map = &null_group_commands_map_; |
| 340 } else if (IsEqualGUID(*cmd_group_guid, CGID_MSHTML)) { | 339 } else if (IsEqualGUID(*cmd_group_guid, CGID_MSHTML)) { |
| 341 command_map = &mshtml_group_commands_map_; | 340 command_map = &mshtml_group_commands_map_; |
| 342 } else if (IsEqualGUID(*cmd_group_guid, CGID_Explorer)) { | 341 } else if (IsEqualGUID(*cmd_group_guid, CGID_Explorer)) { |
| 343 command_map = &explorer_group_commands_map_; | 342 command_map = &explorer_group_commands_map_; |
| 344 } else if (IsEqualGUID(*cmd_group_guid, CGID_ShellDocView)) { | 343 } else if (IsEqualGUID(*cmd_group_guid, CGID_ShellDocView)) { |
| 345 command_map = &shdoc_view_group_commands_map_; | 344 command_map = &shdoc_view_group_commands_map_; |
| 346 } | 345 } |
| 347 } else { | 346 } else { |
| 348 command_map = &null_group_commands_map_; | 347 command_map = &null_group_commands_map_; |
| 349 } | 348 } |
| 350 | 349 |
| 351 if (!command_map) { | 350 if (!command_map) { |
| 352 DLOG(INFO) << "unsupported command group: " | 351 DVLOG(1) << "unsupported command group: " << GuidToString(*cmd_group_guid); |
| 353 << GuidToString(*cmd_group_guid); | |
| 354 return OLECMDERR_E_NOTSUPPORTED; | 352 return OLECMDERR_E_NOTSUPPORTED; |
| 355 } | 353 } |
| 356 | 354 |
| 357 for (ULONG command_index = 0; command_index < number_of_commands; | 355 for (ULONG command_index = 0; command_index < number_of_commands; |
| 358 command_index++) { | 356 command_index++) { |
| 359 DLOG(INFO) << "Command id = " << commands[command_index].cmdID; | 357 DVLOG(1) << "Command id = " << commands[command_index].cmdID; |
| 360 CommandStatusMap::iterator index = | 358 CommandStatusMap::iterator index = |
| 361 command_map->find(commands[command_index].cmdID); | 359 command_map->find(commands[command_index].cmdID); |
| 362 if (index != command_map->end()) | 360 if (index != command_map->end()) |
| 363 commands[command_index].cmdf = index->second; | 361 commands[command_index].cmdf = index->second; |
| 364 } | 362 } |
| 365 return S_OK; | 363 return S_OK; |
| 366 } | 364 } |
| 367 | 365 |
| 368 STDMETHODIMP ChromeActiveDocument::Exec(const GUID* cmd_group_guid, | 366 STDMETHODIMP ChromeActiveDocument::Exec(const GUID* cmd_group_guid, |
| 369 DWORD command_id, | 367 DWORD command_id, |
| 370 DWORD cmd_exec_opt, | 368 DWORD cmd_exec_opt, |
| 371 VARIANT* in_args, | 369 VARIANT* in_args, |
| 372 VARIANT* out_args) { | 370 VARIANT* out_args) { |
| 373 DLOG(INFO) << __FUNCTION__ << " Cmd id =" << command_id; | 371 DVLOG(1) << __FUNCTION__ << " Cmd id =" << command_id; |
| 374 // Bail out if we have been uninitialized. | 372 // Bail out if we have been uninitialized. |
| 375 if (automation_client_.get() && automation_client_->tab()) { | 373 if (automation_client_.get() && automation_client_->tab()) { |
| 376 return ProcessExecCommand(cmd_group_guid, command_id, cmd_exec_opt, | 374 return ProcessExecCommand(cmd_group_guid, command_id, cmd_exec_opt, |
| 377 in_args, out_args); | 375 in_args, out_args); |
| 378 } else if (command_id == OLECMDID_REFRESH && cmd_group_guid == NULL) { | 376 } else if (command_id == OLECMDID_REFRESH && cmd_group_guid == NULL) { |
| 379 // If the automation server has crashed and the user is refreshing the | 377 // If the automation server has crashed and the user is refreshing the |
| 380 // page, let OnRefreshPage attempt to recover. | 378 // page, let OnRefreshPage attempt to recover. |
| 381 OnRefreshPage(cmd_group_guid, command_id, cmd_exec_opt, in_args, out_args); | 379 OnRefreshPage(cmd_group_guid, command_id, cmd_exec_opt, in_args, out_args); |
| 382 } | 380 } |
| 383 | 381 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 } | 597 } |
| 600 } | 598 } |
| 601 } | 599 } |
| 602 m_spClientSite->ShowObject(); | 600 m_spClientSite->ShowObject(); |
| 603 return S_OK; | 601 return S_OK; |
| 604 } | 602 } |
| 605 | 603 |
| 606 void ChromeActiveDocument::OnNavigationStateChanged(int tab_handle, int flags, | 604 void ChromeActiveDocument::OnNavigationStateChanged(int tab_handle, int flags, |
| 607 const IPC::NavigationInfo& nav_info) { | 605 const IPC::NavigationInfo& nav_info) { |
| 608 // TODO(joshia): handle INVALIDATE_TAB,INVALIDATE_LOAD etc. | 606 // TODO(joshia): handle INVALIDATE_TAB,INVALIDATE_LOAD etc. |
| 609 DLOG(INFO) << __FUNCTION__ << std::endl << " Flags: " << flags | 607 DVLOG(1) << __FUNCTION__ |
| 610 << "Url: " << nav_info.url << | 608 << "\n Flags: " << flags |
| 611 ", Title: " << nav_info.title << | 609 << ", Url: " << nav_info.url |
| 612 ", Type: " << nav_info.navigation_type << ", Relative Offset: " << | 610 << ", Title: " << nav_info.title |
| 613 nav_info.relative_offset << ", Index: " << nav_info.navigation_index; | 611 << ", Type: " << nav_info.navigation_type |
| 612 << ", Relative Offset: " << nav_info.relative_offset |
| 613 << ", Index: " << nav_info.navigation_index; |
| 614 | 614 |
| 615 UpdateNavigationState(nav_info); | 615 UpdateNavigationState(nav_info); |
| 616 } | 616 } |
| 617 | 617 |
| 618 void ChromeActiveDocument::OnUpdateTargetUrl(int tab_handle, | 618 void ChromeActiveDocument::OnUpdateTargetUrl(int tab_handle, |
| 619 const std::wstring& new_target_url) { | 619 const std::wstring& new_target_url) { |
| 620 if (in_place_frame_) | 620 if (in_place_frame_) |
| 621 in_place_frame_->SetStatusText(new_target_url.c_str()); | 621 in_place_frame_->SetStatusText(new_target_url.c_str()); |
| 622 } | 622 } |
| 623 | 623 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 642 } | 642 } |
| 643 | 643 |
| 644 if (!handled_accel) { | 644 if (!handled_accel) { |
| 645 if (IsFindAccelerator(accel_message)) { | 645 if (IsFindAccelerator(accel_message)) { |
| 646 // Handle the showing of the find dialog explicitly. | 646 // Handle the showing of the find dialog explicitly. |
| 647 OnFindInPage(); | 647 OnFindInPage(); |
| 648 } else { | 648 } else { |
| 649 BaseActiveX::OnAcceleratorPressed(tab_handle, accel_message); | 649 BaseActiveX::OnAcceleratorPressed(tab_handle, accel_message); |
| 650 } | 650 } |
| 651 } else { | 651 } else { |
| 652 DLOG(INFO) << "IE handled accel key " << accel_message.wParam; | 652 DVLOG(1) << "IE handled accel key " << accel_message.wParam; |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 | 655 |
| 656 void ChromeActiveDocument::OnTabbedOut(int tab_handle, bool reverse) { | 656 void ChromeActiveDocument::OnTabbedOut(int tab_handle, bool reverse) { |
| 657 DLOG(INFO) << __FUNCTION__; | 657 DVLOG(1) << __FUNCTION__; |
| 658 if (in_place_frame_) { | 658 if (in_place_frame_) { |
| 659 MSG msg = { NULL, WM_KEYDOWN, VK_TAB }; | 659 MSG msg = { NULL, WM_KEYDOWN, VK_TAB }; |
| 660 in_place_frame_->TranslateAcceleratorW(&msg, 0); | 660 in_place_frame_->TranslateAcceleratorW(&msg, 0); |
| 661 } | 661 } |
| 662 } | 662 } |
| 663 | 663 |
| 664 void ChromeActiveDocument::OnDidNavigate(int tab_handle, | 664 void ChromeActiveDocument::OnDidNavigate(int tab_handle, |
| 665 const IPC::NavigationInfo& nav_info) { | 665 const IPC::NavigationInfo& nav_info) { |
| 666 DLOG(INFO) << __FUNCTION__ << std::endl << "Url: " << nav_info.url << | 666 DVLOG(1) << __FUNCTION__ << std::endl |
| 667 ", Title: " << nav_info.title << | 667 << "Url: " << nav_info.url |
| 668 ", Type: " << nav_info.navigation_type << ", Relative Offset: " << | 668 << ", Title: " << nav_info.title |
| 669 nav_info.relative_offset << ", Index: " << nav_info.navigation_index; | 669 << ", Type: " << nav_info.navigation_type |
| 670 << ", Relative Offset: " << nav_info.relative_offset |
| 671 << ", Index: " << nav_info.navigation_index; |
| 670 | 672 |
| 671 CrashMetricsReporter::GetInstance()->IncrementMetric( | 673 CrashMetricsReporter::GetInstance()->IncrementMetric( |
| 672 CrashMetricsReporter::CHROME_FRAME_NAVIGATION_COUNT); | 674 CrashMetricsReporter::CHROME_FRAME_NAVIGATION_COUNT); |
| 673 | 675 |
| 674 // This could be NULL if the active document instance is being destroyed. | 676 // This could be NULL if the active document instance is being destroyed. |
| 675 if (!m_spInPlaceSite) { | 677 if (!m_spInPlaceSite) { |
| 676 DLOG(INFO) << __FUNCTION__ << "m_spInPlaceSite is NULL. Returning"; | 678 DVLOG(1) << __FUNCTION__ << "m_spInPlaceSite is NULL. Returning"; |
| 677 return; | 679 return; |
| 678 } | 680 } |
| 679 | 681 |
| 680 UpdateNavigationState(nav_info); | 682 UpdateNavigationState(nav_info); |
| 681 } | 683 } |
| 682 | 684 |
| 683 void ChromeActiveDocument::OnCloseTab(int tab_handle) { | 685 void ChromeActiveDocument::OnCloseTab(int tab_handle) { |
| 684 ScopedComPtr<IWebBrowser2> web_browser2; | 686 ScopedComPtr<IWebBrowser2> web_browser2; |
| 685 DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); | 687 DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); |
| 686 if (web_browser2) | 688 if (web_browser2) |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 profile = GetHostProcessName(false); | 1045 profile = GetHostProcessName(false); |
| 1044 return InitializeAutomation(profile, L"", IsIEInPrivate(), | 1046 return InitializeAutomation(profile, L"", IsIEInPrivate(), |
| 1045 false, cf_url.gurl(), GURL(referrer), | 1047 false, cf_url.gurl(), GURL(referrer), |
| 1046 false); | 1048 false); |
| 1047 } | 1049 } |
| 1048 } | 1050 } |
| 1049 | 1051 |
| 1050 | 1052 |
| 1051 HRESULT ChromeActiveDocument::OnRefreshPage(const GUID* cmd_group_guid, | 1053 HRESULT ChromeActiveDocument::OnRefreshPage(const GUID* cmd_group_guid, |
| 1052 DWORD command_id, DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args) { | 1054 DWORD command_id, DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args) { |
| 1053 DLOG(INFO) << __FUNCTION__; | 1055 DVLOG(1) << __FUNCTION__; |
| 1054 popup_allowed_ = false; | 1056 popup_allowed_ = false; |
| 1055 if (in_args->vt == VT_I4 && | 1057 if (in_args->vt == VT_I4 && |
| 1056 in_args->lVal & OLECMDIDF_REFRESH_PAGEACTION_POPUPWINDOW) { | 1058 in_args->lVal & OLECMDIDF_REFRESH_PAGEACTION_POPUPWINDOW) { |
| 1057 popup_allowed_ = true; | 1059 popup_allowed_ = true; |
| 1058 | 1060 |
| 1059 // Ask the yellow security band to change the text and icon and to remain | 1061 // Ask the yellow security band to change the text and icon and to remain |
| 1060 // visible. | 1062 // visible. |
| 1061 IEExec(&CGID_DocHostCommandHandler, OLECMDID_PAGEACTIONBLOCKED, | 1063 IEExec(&CGID_DocHostCommandHandler, OLECMDID_PAGEACTIONBLOCKED, |
| 1062 0x80000000 | OLECMDIDF_WINDOWSTATE_USERVISIBLE_VALID, NULL, NULL); | 1064 0x80000000 | OLECMDIDF_WINDOWSTATE_USERVISIBLE_VALID, NULL, NULL); |
| 1063 } | 1065 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 // Like we did on SetPageFontSize, we may forward the command back to IEFrame | 1178 // Like we did on SetPageFontSize, we may forward the command back to IEFrame |
| 1177 // to update the menu state to indicate that which encoding was set. | 1179 // to update the menu state to indicate that which encoding was set. |
| 1178 // TODO(iyengar) | 1180 // TODO(iyengar) |
| 1179 // Do some investigation into why this Exec call fails. | 1181 // Do some investigation into why this Exec call fails. |
| 1180 IEExec(&CGID_ExplorerBarDoc, command_id, cmd_exec_opt, NULL, NULL); | 1182 IEExec(&CGID_ExplorerBarDoc, command_id, cmd_exec_opt, NULL, NULL); |
| 1181 return S_OK; | 1183 return S_OK; |
| 1182 } | 1184 } |
| 1183 | 1185 |
| 1184 void ChromeActiveDocument::OnGoToHistoryEntryOffset(int tab_handle, | 1186 void ChromeActiveDocument::OnGoToHistoryEntryOffset(int tab_handle, |
| 1185 int offset) { | 1187 int offset) { |
| 1186 DLOG(INFO) << __FUNCTION__ << " - offset:" << offset; | 1188 DVLOG(1) << __FUNCTION__ << " - offset:" << offset; |
| 1187 | 1189 |
| 1188 ScopedComPtr<IBrowserService> browser_service; | 1190 ScopedComPtr<IBrowserService> browser_service; |
| 1189 ScopedComPtr<ITravelLog> travel_log; | 1191 ScopedComPtr<ITravelLog> travel_log; |
| 1190 GetBrowserServiceAndTravelLog(browser_service.Receive(), | 1192 GetBrowserServiceAndTravelLog(browser_service.Receive(), |
| 1191 travel_log.Receive()); | 1193 travel_log.Receive()); |
| 1192 | 1194 |
| 1193 if (browser_service && travel_log) | 1195 if (browser_service && travel_log) |
| 1194 travel_log->Travel(browser_service, offset); | 1196 travel_log->Travel(browser_service, offset); |
| 1195 } | 1197 } |
| 1196 | 1198 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 GiveFocusToChrome(false); | 1285 GiveFocusToChrome(false); |
| 1284 return 0; | 1286 return 0; |
| 1285 } | 1287 } |
| 1286 | 1288 |
| 1287 void ChromeActiveDocument::SetWindowDimensions() { | 1289 void ChromeActiveDocument::SetWindowDimensions() { |
| 1288 ScopedComPtr<IWebBrowser2> web_browser2; | 1290 ScopedComPtr<IWebBrowser2> web_browser2; |
| 1289 DoQueryService(SID_SWebBrowserApp, m_spClientSite, | 1291 DoQueryService(SID_SWebBrowserApp, m_spClientSite, |
| 1290 web_browser2.Receive()); | 1292 web_browser2.Receive()); |
| 1291 if (!web_browser2) | 1293 if (!web_browser2) |
| 1292 return; | 1294 return; |
| 1293 DLOG(INFO) << "this:" << this; | 1295 DVLOG(1) << "this:" << this << "\ndimensions: width:" << dimensions_.width() |
| 1294 DLOG(INFO) << "dimensions: width:" << dimensions_.width() | 1296 << " height:" << dimensions_.height(); |
| 1295 << "height:" << dimensions_.height(); | |
| 1296 if (!dimensions_.IsEmpty()) { | 1297 if (!dimensions_.IsEmpty()) { |
| 1297 web_browser2->put_Width(dimensions_.width()); | 1298 web_browser2->put_Width(dimensions_.width()); |
| 1298 web_browser2->put_Height(dimensions_.height()); | 1299 web_browser2->put_Height(dimensions_.height()); |
| 1299 web_browser2->put_Left(dimensions_.x()); | 1300 web_browser2->put_Left(dimensions_.x()); |
| 1300 web_browser2->put_Top(dimensions_.y()); | 1301 web_browser2->put_Top(dimensions_.y()); |
| 1301 web_browser2->put_MenuBar(VARIANT_FALSE); | 1302 web_browser2->put_MenuBar(VARIANT_FALSE); |
| 1302 web_browser2->put_ToolBar(VARIANT_FALSE); | 1303 web_browser2->put_ToolBar(VARIANT_FALSE); |
| 1303 | 1304 |
| 1304 dimensions_.set_height(0); | 1305 dimensions_.set_height(0); |
| 1305 dimensions_.set_width(0); | 1306 dimensions_.set_width(0); |
| 1306 } | 1307 } |
| 1307 } | 1308 } |
| OLD | NEW |