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

Side by Side Diff: chrome/browser/ui/user_manager.cc

Issue 2552473002: Display error message when user try to open a locked supervised user profile when force-sign-in is … (Closed)
Patch Set: refacotr Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/user_manager.h" 5 #include "chrome/browser/ui/user_manager.h"
6 6
7 #include "components/guest_view/browser/guest_view_manager.h" 7 #include "components/guest_view/browser/guest_view_manager.h"
8 8
9 namespace { 9 namespace {
10 10
11 bool AddToSet(std::set<content::WebContents*>* content_set, 11 bool AddToSet(std::set<content::WebContents*>* content_set,
12 content::WebContents* web_contents) { 12 content::WebContents* web_contents) {
13 content_set->insert(web_contents); 13 content_set->insert(web_contents);
14 return false; 14 return false;
15 } 15 }
16 16
17 } // namespace 17 } // namespace
18 18
19 UserManager::BaseReauthDialogDelegate::BaseReauthDialogDelegate() 19 UserManagerDialog::BaseDialogDelegate::BaseDialogDelegate()
20 : guest_web_contents_(nullptr) {} 20 : guest_web_contents_(nullptr) {}
21 21
22 bool UserManager::BaseReauthDialogDelegate::HandleContextMenu( 22 bool UserManagerDialog::BaseDialogDelegate::HandleContextMenu(
23 const content::ContextMenuParams& params) { 23 const content::ContextMenuParams& params) {
24 // Ignores context menu. 24 // Ignores context menu.
25 return true; 25 return true;
26 } 26 }
27 27
28 void UserManager::BaseReauthDialogDelegate::LoadingStateChanged( 28 void UserManagerDialog::BaseDialogDelegate::LoadingStateChanged(
29 content::WebContents* source, bool to_different_document) { 29 content::WebContents* source,
30 bool to_different_document) {
30 if (source->IsLoading() || guest_web_contents_) 31 if (source->IsLoading() || guest_web_contents_)
31 return; 32 return;
32 33
33 // Try to find the embedded WebView and manage its WebContents. The WebView 34 // Try to find the embedded WebView and manage its WebContents. The WebView
34 // may not be found in the initial page load since it loads asynchronously. 35 // may not be found in the initial page load since it loads asynchronously.
35 std::set<content::WebContents*> content_set; 36 std::set<content::WebContents*> content_set;
36 guest_view::GuestViewManager* manager = 37 guest_view::GuestViewManager* manager =
37 guest_view::GuestViewManager::FromBrowserContext( 38 guest_view::GuestViewManager::FromBrowserContext(
38 source->GetBrowserContext()); 39 source->GetBrowserContext());
39 if (manager) 40 if (manager)
40 manager->ForEachGuest(source, base::Bind(&AddToSet, &content_set)); 41 manager->ForEachGuest(source, base::Bind(&AddToSet, &content_set));
41 DCHECK_LE(content_set.size(), 1U); 42 DCHECK_LE(content_set.size(), 1U);
42 if (!content_set.empty()) { 43 if (!content_set.empty()) {
43 guest_web_contents_ = *content_set.begin(); 44 guest_web_contents_ = *content_set.begin();
44 guest_web_contents_->SetDelegate(this); 45 guest_web_contents_->SetDelegate(this);
45 } 46 }
46 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698