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

Unified Diff: chrome/browser/chromeos/login/simple_web_view_dialog.cc

Issue 10388166: Construct a TCW for the login view's WebView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
Index: chrome/browser/chromeos/login/simple_web_view_dialog.cc
===================================================================
--- chrome/browser/chromeos/login/simple_web_view_dialog.cc (revision 137201)
+++ chrome/browser/chromeos/login/simple_web_view_dialog.cc (working copy)
@@ -10,9 +10,10 @@
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/chromeos/login/captive_portal_window_proxy.h"
-#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/location_bar/location_icon_view.h"
@@ -141,7 +142,18 @@
void SimpleWebViewDialog::StartLoad(const GURL& url) {
web_view_container_.reset(new views::WebView(profile_));
web_view_ = web_view_container_.get();
- web_view_->GetWebContents()->SetDelegate(this);
+
+ // We create the WebContents ourselves because the TCW assumes ownership of
+ // it. This should be reworked once we don't need to use the TCW here.
+ WebContents* web_contents =
+ WebContents::Create(ProfileManager::GetDefaultProfile(),
+ NULL,
+ MSG_ROUTING_NONE,
+ NULL,
+ NULL);
+ wrapper_.reset(new TabContentsWrapper(web_contents));
+ web_view_->SetWebContents(web_contents);
+ web_contents->SetDelegate(this);
web_view_->LoadInitialURL(url);
}
« no previous file with comments | « chrome/browser/chromeos/login/simple_web_view_dialog.h ('k') | chrome/browser/chromeos/login/webui_login_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698