Commit 15b1d752 authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

WebUI: Fix Welcome Windows 10 Handler's navigation to the NTP

Previously, the Windows 10 Handler navigated to the NTP by making the
WebContents load the URL of the NTP.

That's is mostly correct, except that it doesn't tell the Browser to
update the omnibox.

This CL makes the Windows 10 Welcome Handler act the same way as the
normal Welcome Handler, which performs a navigation at the chrome/
with a Browser object instead of at the content/ level with a
WebContents object.

It used to work before accidentally, essentially.

Bug: 954120
Change-Id: I5514044f32ae542de52c8aba8c08373de1e84b53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1576138
Auto-Submit: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652905}
parent d0c35dd3
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/shell_integration.h" #include "chrome/browser/shell_integration.h"
#include "chrome/browser/shell_integration_win.h" #include "chrome/browser/shell_integration_win.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -140,9 +143,12 @@ void WelcomeWin10Handler::HandleSetDefaultBrowser(const base::ListValue* args) { ...@@ -140,9 +143,12 @@ void WelcomeWin10Handler::HandleSetDefaultBrowser(const base::ListValue* args) {
} }
void WelcomeWin10Handler::HandleContinue(const base::ListValue* args) { void WelcomeWin10Handler::HandleContinue(const base::ListValue* args) {
web_ui()->GetWebContents()->GetController().LoadURL( content::WebContents* contents = web_ui()->GetWebContents();
GURL(chrome::kChromeUINewTabURL), content::Referrer(), Browser* browser = chrome::FindBrowserWithWebContents(contents);
ui::PageTransition::PAGE_TRANSITION_LINK, std::string()); NavigateParams params(browser, GURL(chrome::kChromeUINewTabURL),
ui::PageTransition::PAGE_TRANSITION_LINK);
params.source_contents = web_ui()->GetWebContents();
Navigate(&params);
} }
void WelcomeWin10Handler::StartIsPinnedToTaskbarCheck() { void WelcomeWin10Handler::StartIsPinnedToTaskbarCheck() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment