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

Unified Diff: chrome/browser/chromeos/login/ui/login_web_dialog.cc

Issue 812763003: Fix browser launch on the login screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, fix nits. Created 5 years, 11 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/chromeos/login/ui/login_web_dialog.h ('k') | ui/views/controls/webview/web_dialog_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/ui/login_web_dialog.cc
diff --git a/chrome/browser/chromeos/login/ui/login_web_dialog.cc b/chrome/browser/chromeos/login/ui/login_web_dialog.cc
index 9e1a215b67b74e718b45710c10ecfd7073b456a8..4c3a0dd8dec2707ef47a96a8085164235aa12875 100644
--- a/chrome/browser/chromeos/login/ui/login_web_dialog.cc
+++ b/chrome/browser/chromeos/login/ui/login_web_dialog.cc
@@ -10,6 +10,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
@@ -157,6 +158,23 @@ bool LoginWebDialog::HandleContextMenu(
return true;
}
+bool LoginWebDialog::HandleOpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params,
+ content::WebContents** out_new_contents) {
+ // On a login screen, if a missing extension is trying to show in a web
+ // dialog, a NetErrorHelper is displayed instead (hence we have a |source|),
+ // but there is no browser window associated with it. A helper screen will
+ // fire an auto-reload, which in turn leads to opening a new browser window,
+ // so we must suppress it.
+ // http://crbug.com/443096
+ return (source && !chrome::FindBrowserWithWebContents(source));
+}
+
+bool LoginWebDialog::HandleShouldCreateWebContents() {
+ return false;
+}
+
void LoginWebDialog::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
« no previous file with comments | « chrome/browser/chromeos/login/ui/login_web_dialog.h ('k') | ui/views/controls/webview/web_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698