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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h" 5 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/chromeos/login/helper.h" 11 #include "chrome/browser/chromeos/login/helper.h"
12 #include "chrome/browser/ui/browser_dialogs.h" 12 #include "chrome/browser/ui/browser_dialogs.h"
13 #include "chrome/browser/ui/browser_finder.h"
13 #include "content/public/browser/browser_context.h" 14 #include "content/public/browser/browser_context.h"
14 #include "content/public/browser/notification_source.h" 15 #include "content/public/browser/notification_source.h"
15 #include "content/public/browser/notification_types.h" 16 #include "content/public/browser/notification_types.h"
16 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
17 #include "ui/gfx/geometry/rect.h" 18 #include "ui/gfx/geometry/rect.h"
18 #include "ui/gfx/geometry/size.h" 19 #include "ui/gfx/geometry/size.h"
19 #include "ui/gfx/native_widget_types.h" 20 #include "ui/gfx/native_widget_types.h"
20 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
21 22
22 using content::WebContents; 23 using content::WebContents;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 bool LoginWebDialog::ShouldShowDialogTitle() const { 151 bool LoginWebDialog::ShouldShowDialogTitle() const {
151 return true; 152 return true;
152 } 153 }
153 154
154 bool LoginWebDialog::HandleContextMenu( 155 bool LoginWebDialog::HandleContextMenu(
155 const content::ContextMenuParams& params) { 156 const content::ContextMenuParams& params) {
156 // Disable context menu. 157 // Disable context menu.
157 return true; 158 return true;
158 } 159 }
159 160
161 bool LoginWebDialog::HandleOpenURLFromTab(
162 content::WebContents* source,
163 const content::OpenURLParams& params,
164 content::WebContents** out_new_contents) {
165 // On a login screen, if a missing extension is trying to show in a web
166 // dialog, a NetErrorHelper is displayed instead (hence we have a |source|),
167 // but there is no browser window associated with it. A helper screen will
168 // fire an auto-reload, which in turn leads to opening a new browser window,
169 // so we must suppress it.
170 // http://crbug.com/443096
171 return (source && !chrome::FindBrowserWithWebContents(source));
172 }
173
174 bool LoginWebDialog::HandleShouldCreateWebContents() {
175 return false;
176 }
177
160 void LoginWebDialog::Observe(int type, 178 void LoginWebDialog::Observe(int type,
161 const content::NotificationSource& source, 179 const content::NotificationSource& source,
162 const content::NotificationDetails& details) { 180 const content::NotificationDetails& details) {
163 DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); 181 DCHECK(type == content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME);
164 // TODO(saintlou): Do we need a throbber for Aura? 182 // TODO(saintlou): Do we need a throbber for Aura?
165 NOTIMPLEMENTED(); 183 NOTIMPLEMENTED();
166 } 184 }
167 185
168 } // namespace chromeos 186 } // namespace chromeos
OLDNEW
« 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