Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: chrome/browser/tab_contents/interstitial_page.cc

Issue 40095: Enable interstitial pages for SSL certificate errors on Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/interstitial_page.cc
===================================================================
--- chrome/browser/tab_contents/interstitial_page.cc (revision 11029)
+++ chrome/browser/tab_contents/interstitial_page.cc (working copy)
@@ -21,6 +21,9 @@
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
#include "chrome/browser/tab_contents/web_contents_view_win.h"
#include "chrome/views/window.h"
+#else
+#include "chrome/browser/renderer_host/render_widget_host_view.h"
+#include "chrome/browser/tab_contents/web_contents_view.h"
#endif
namespace {
@@ -263,11 +266,22 @@
return render_view_host;
#else
- // TODO(port): RenderWidgetHost* is implemented, but Create and
- // set_parent_hwnd are specific to RenderWidgetHostWin, so this should
- // probably be refactored.
+ // It is untested, whether this code is sufficiently generic that it
+ // works with Windows, and thus obsoletes the special-cased code above.
+ // If it does work, don't forget to also clean up the include statements!
NOTIMPLEMENTED();
- return NULL;
+
+ RenderViewHost* render_view_host = new RenderViewHost(
+ SiteInstance::CreateSiteInstance(tab()->profile()),
+ this, MSG_ROUTING_NONE, NULL);
+ WebContentsView* web_contents_view = tab()->view();
+ RenderWidgetHostView* view =
+ web_contents_view->CreateViewForWidget(render_view_host);
+ render_view_host->set_view(view);
+ render_view_host->AllowDomAutomationBindings();
+ render_view_host->CreateRenderView();
+ view->SetSize(web_contents_view->GetContainerSize());
+ return render_view_host;
#endif
}
@@ -348,7 +362,6 @@
void InterstitialPage::DidNavigate(
RenderViewHost* render_view_host,
const ViewHostMsg_FrameNavigate_Params& params) {
-#if defined(OS_WIN)
// A fast user could have navigated away from the page that triggered the
// interstitial while the interstitial was loading, that would have disabled
// us. In that case we can dismiss ourselves.
@@ -366,10 +379,6 @@
// by the UI tests) expects to consider a navigation as complete. Without this,
// navigating in a UI test to a URL that triggers an interstitial would hang.
tab_->SetIsLoading(false, NULL);
-#else
- // TODO(port): we need RenderViewHost.
- NOTIMPLEMENTED();
-#endif
}
void InterstitialPage::RenderViewGone(RenderViewHost* render_view_host) {
@@ -512,4 +521,3 @@
int request_id, int number_of_matches, const gfx::Rect& selection_rect,
int active_match_ordinal, bool final_update) {
}
-
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698