Chromium Code Reviews| Index: chrome_frame/bho.cc |
| =================================================================== |
| --- chrome_frame/bho.cc (revision 63369) |
| +++ chrome_frame/bho.cc (working copy) |
| @@ -14,6 +14,7 @@ |
| #include "base/win/scoped_bstr.h" |
| #include "chrome_tab.h" // NOLINT |
| #include "chrome_frame/crash_reporting/crash_metrics.h" |
| +#include "chrome_frame/ready_prompt.h" |
|
grt (UTC plus 2)
2010/11/10 17:59:29
Sort.
|
| #include "chrome_frame/extra_system_apis.h" |
| #include "chrome_frame/http_negotiate.h" |
| #include "chrome_frame/metrics_service.h" |
| @@ -151,6 +152,25 @@ |
| web_browser2.QueryFrom(dispatch); |
| if (web_browser2) { |
| + if (infobar_manager_ == NULL) { |
| + ScopedComPtr<IServiceProvider> service_provider; |
|
amit
2010/11/12 00:04:49
Check for whether or not to show infobar is still
erikwright (departed)
2010/11/24 06:24:56
Yes. Now factored out into a separate CL.
|
| + if (SUCCEEDED(service_provider.QueryFrom(web_browser2))) { |
| + ScopedComPtr<IOleWindow> ole_window; |
| + if (SUCCEEDED(service_provider->QueryService( |
| + SID_SShellBrowser, IID_IOleWindow, (void**)ole_window.Receive()))) { |
| + HWND web_browserhwnd = NULL; |
| + if (SUCCEEDED(ole_window->GetWindow(&web_browserhwnd))) |
| + infobar_manager_.reset(new InfobarManager(web_browserhwnd)); |
| + } |
| + } |
| + } |
| + if (infobar_manager_ != NULL) { |
| + InfobarContent* content = new ReadyPromptContent(); |
| + if(!SUCCEEDED(infobar_manager_->Show(content, TOP_INFOBAR, 38))) { |
| + delete content; |
|
grt (UTC plus 2)
2010/11/10 17:59:29
Making callers remember to delete the instance if
erikwright (departed)
2010/11/24 06:24:56
It now unequivocally takes ownership upon Show.
|
| + } |
| + } |
|
grt (UTC plus 2)
2010/11/10 17:59:29
I see lots of checking for unexpected return codes
erikwright (departed)
2010/11/24 06:24:56
Yes. This is just a sample integration for now.
|
| + |
| VARIANT_BOOL is_top_level = VARIANT_FALSE; |
| web_browser2->get_TopLevelContainer(&is_top_level); |
| if (is_top_level) { |