| 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 // CeeeExecutor implementation | 5 // CeeeExecutor implementation |
| 6 // | 6 // |
| 7 // We use interfaces named ITabWindowManager and ITabWindow | 7 // We use interfaces named ITabWindowManager and ITabWindow |
| 8 // (documented at | 8 // (documented at |
| 9 // http://www.geoffchappell.com/viewer.htm?doc=studies/windows/ie/ieframe/interf
aces/itabwindowmanager.htm | 9 // http://www.geoffchappell.com/viewer.htm?doc=studies/windows/ie/ieframe/interf
aces/itabwindowmanager.htm |
| 10 // and | 10 // and |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 DCHECK(sync != NULL); | 364 DCHECK(sync != NULL); |
| 365 | 365 |
| 366 hr = sync->Signal(); | 366 hr = sync->Signal(); |
| 367 if (FAILED(hr)) | 367 if (FAILED(hr)) |
| 368 LOG(ERROR) << "Failed to signal " << com::LogHr(hr); | 368 LOG(ERROR) << "Failed to signal " << com::LogHr(hr); |
| 369 | 369 |
| 370 return hr; | 370 return hr; |
| 371 } | 371 } |
| 372 | 372 |
| 373 CeeeExecutor::CeeeExecutor() : hwnd_(NULL) { | 373 CeeeExecutor::CeeeExecutor() |
| 374 : hwnd_(NULL), |
| 375 // Don't restart on broker crash. It won't work because executor was |
| 376 // already registered in dead broker. |
| 377 broker_rpc_client_(false) { |
| 374 } | 378 } |
| 375 | 379 |
| 376 CeeeExecutor::~CeeeExecutor() { | 380 CeeeExecutor::~CeeeExecutor() { |
| 377 } | 381 } |
| 378 | 382 |
| 379 HRESULT CeeeExecutor::CreateTabCall(ICeeeTabExecutor* executor, | 383 HRESULT CeeeExecutor::CreateTabCall(ICeeeTabExecutor* executor, |
| 380 IUnknown *outer, | 384 IUnknown *outer, |
| 381 REFIID riid2, | 385 REFIID riid2, |
| 382 IUnknown **out) { | 386 IUnknown **out) { |
| 383 CComPtr<IUnknown> tab_call; | 387 CComPtr<IUnknown> tab_call; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 return hr; | 423 return hr; |
| 420 } | 424 } |
| 421 | 425 |
| 422 // If this is tab window then create the infobar manager. | 426 // If this is tab window then create the infobar manager. |
| 423 // TODO(mad@chromium.org): We are starting to need to have different classes | 427 // TODO(mad@chromium.org): We are starting to need to have different classes |
| 424 // for the different executors. | 428 // for the different executors. |
| 425 // TODO(hansl@chromium.org): We might not need to have an Executor for | 429 // TODO(hansl@chromium.org): We might not need to have an Executor for |
| 426 // Infobar. In any case, the construction below should have a reference to | 430 // Infobar. In any case, the construction below should have a reference to |
| 427 // a BHO and its EventSender so we don't create Infobars before the tab_id | 431 // a BHO and its EventSender so we don't create Infobars before the tab_id |
| 428 // is ready. | 432 // is ready. |
| 429 if (window_utils::GetTopLevelParent(hwnd_) != hwnd_) | 433 if (window_utils::GetTopLevelParent(hwnd_) != hwnd_) { |
| 434 hr = broker_rpc_client_.Connect(true); |
| 435 if (FAILED(hr)) |
| 436 return hr; |
| 430 infobar_manager_.reset( | 437 infobar_manager_.reset( |
| 431 new infobar_api::InfobarManager(hwnd_, new BrokerRpcClient(false))); | 438 new infobar_api::InfobarManager(hwnd_, &broker_rpc_client_)); |
| 439 } |
| 432 | 440 |
| 433 return S_OK; | 441 return S_OK; |
| 434 } | 442 } |
| 435 | 443 |
| 436 HRESULT CeeeExecutor::GetWebBrowser(IWebBrowser2** browser) { | 444 HRESULT CeeeExecutor::GetWebBrowser(IWebBrowser2** browser) { |
| 437 DCHECK(browser); | 445 DCHECK(browser); |
| 438 CComPtr<IFrameEventHandlerHost> frame_handler_host; | 446 CComPtr<IFrameEventHandlerHost> frame_handler_host; |
| 439 HRESULT hr = GetSite(IID_IFrameEventHandlerHost, | 447 HRESULT hr = GetSite(IID_IFrameEventHandlerHost, |
| 440 reinterpret_cast<void**>(&frame_handler_host)); | 448 reinterpret_cast<void**>(&frame_handler_host)); |
| 441 if (FAILED(hr)) { | 449 if (FAILED(hr)) { |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 | 1014 |
| 1007 STDMETHODIMP CeeeExecutor::OnTopFrameBeforeNavigate(BSTR url) { | 1015 STDMETHODIMP CeeeExecutor::OnTopFrameBeforeNavigate(BSTR url) { |
| 1008 DCHECK(infobar_manager_ != NULL) << "infobar_manager_ is not initialized"; | 1016 DCHECK(infobar_manager_ != NULL) << "infobar_manager_ is not initialized"; |
| 1009 if (infobar_manager_ == NULL) | 1017 if (infobar_manager_ == NULL) |
| 1010 return E_FAIL; | 1018 return E_FAIL; |
| 1011 | 1019 |
| 1012 // According to the specification, tab navigation closes the infobar. | 1020 // According to the specification, tab navigation closes the infobar. |
| 1013 infobar_manager_->HideAll(); | 1021 infobar_manager_->HideAll(); |
| 1014 return S_OK; | 1022 return S_OK; |
| 1015 } | 1023 } |
| OLD | NEW |