summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/app_list/app_list_view_delegate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/app_list/app_list_view_delegate.cc')
-rw-r--r--chrome/browser/ui/app_list/app_list_view_delegate.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index 6c2bf69..c813ca9 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -6,6 +6,7 @@
#include <vector>
+#include "apps/custom_launcher_page_contents.h"
#include "base/callback.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -162,13 +163,8 @@ AppListViewDelegate::AppListViewDelegate(Profile* profile,
LOG(ERROR) << "Invalid custom launcher page URL: "
<< custom_launcher_page_url.possibly_invalid_spec();
} else {
- content::WebContents::CreateParams params(profile_);
- custom_page_web_contents_.reset(content::WebContents::Create(params));
- custom_page_web_contents_->GetController().LoadURL(
- custom_launcher_page_url,
- content::Referrer(),
- content::PAGE_TRANSITION_AUTO_TOPLEVEL,
- std::string());
+ custom_page_contents_.reset(new apps::CustomLauncherPageContents());
+ custom_page_contents_->Initialize(profile, custom_launcher_page_url);
}
}
}
@@ -472,6 +468,7 @@ views::View* AppListViewDelegate::CreateStartPageWebView(
if (!web_contents)
return NULL;
+ DCHECK_EQ(profile_, web_contents->GetBrowserContext());
views::WebView* web_view = new views::WebView(
web_contents->GetBrowserContext());
web_view->SetPreferredSize(size);
@@ -481,13 +478,16 @@ views::View* AppListViewDelegate::CreateStartPageWebView(
views::View* AppListViewDelegate::CreateCustomPageWebView(
const gfx::Size& size) {
- if (!custom_page_web_contents_)
+ if (!custom_page_contents_)
return NULL;
- views::WebView* web_view = new views::WebView(
- custom_page_web_contents_->GetBrowserContext());
+ content::WebContents* web_contents = custom_page_contents_->web_contents();
+ // TODO(mgiuca): DCHECK_EQ(profile_, web_contents->GetBrowserContext()) after
+ // http://crbug.com/392763 resolved.
+ views::WebView* web_view =
+ new views::WebView(web_contents->GetBrowserContext());
web_view->SetPreferredSize(size);
- web_view->SetWebContents(custom_page_web_contents_.get());
+ web_view->SetWebContents(web_contents);
return web_view;
}
#endif