| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // optimization to get Chrome active documents to load faster. | 76 // optimization to get Chrome active documents to load faster. |
| 77 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); | 77 ChromeActiveDocument* cached_document = g_active_doc_cache.Get(); |
| 78 if (cached_document && cached_document->IsValid()) { | 78 if (cached_document && cached_document->IsValid()) { |
| 79 DCHECK(automation_client_.get() == NULL); | 79 DCHECK(automation_client_.get() == NULL); |
| 80 automation_client_.swap(cached_document->automation_client_); | 80 automation_client_.swap(cached_document->automation_client_); |
| 81 DLOG(INFO) << "Reusing automation client instance from " | 81 DLOG(INFO) << "Reusing automation client instance from " |
| 82 << cached_document; | 82 << cached_document; |
| 83 DCHECK(automation_client_.get() != NULL); | 83 DCHECK(automation_client_.get() != NULL); |
| 84 automation_client_->Reinitialize(this, url_fetcher_.get()); | 84 automation_client_->Reinitialize(this, url_fetcher_.get()); |
| 85 is_automation_client_reused_ = true; | 85 is_automation_client_reused_ = true; |
| 86 OnAutomationServerReady(); |
| 86 } else { | 87 } else { |
| 87 // The FinalConstruct implementation in the ChromeFrameActivexBase class | 88 // The FinalConstruct implementation in the ChromeFrameActivexBase class |
| 88 // i.e. Base creates an instance of the ChromeFrameAutomationClient class | 89 // i.e. Base creates an instance of the ChromeFrameAutomationClient class |
| 89 // and initializes it, which would spawn a new Chrome process, etc. | 90 // and initializes it, which would spawn a new Chrome process, etc. |
| 90 // We don't want to be doing this if we have a cached document, whose | 91 // We don't want to be doing this if we have a cached document, whose |
| 91 // automation client instance can be reused. | 92 // automation client instance can be reused. |
| 92 HRESULT hr = BaseActiveX::FinalConstruct(); | 93 HRESULT hr = BaseActiveX::FinalConstruct(); |
| 93 if (FAILED(hr)) | 94 if (FAILED(hr)) |
| 94 return hr; | 95 return hr; |
| 95 } | 96 } |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 web_browser2->put_Height(dimensions_.height()); | 1250 web_browser2->put_Height(dimensions_.height()); |
| 1250 web_browser2->put_Left(dimensions_.x()); | 1251 web_browser2->put_Left(dimensions_.x()); |
| 1251 web_browser2->put_Top(dimensions_.y()); | 1252 web_browser2->put_Top(dimensions_.y()); |
| 1252 web_browser2->put_MenuBar(VARIANT_FALSE); | 1253 web_browser2->put_MenuBar(VARIANT_FALSE); |
| 1253 web_browser2->put_ToolBar(VARIANT_FALSE); | 1254 web_browser2->put_ToolBar(VARIANT_FALSE); |
| 1254 | 1255 |
| 1255 dimensions_.set_height(0); | 1256 dimensions_.set_height(0); |
| 1256 dimensions_.set_width(0); | 1257 dimensions_.set_width(0); |
| 1257 } | 1258 } |
| 1258 } | 1259 } |
| OLD | NEW |