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

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

Issue 2168953002: Disables the context menu in User Manager's reauth dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial Created 4 years, 5 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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_UI_USER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_UI_USER_MANAGER_H_
6 #define CHROME_BROWSER_UI_USER_MANAGER_H_ 6 #define CHROME_BROWSER_UI_USER_MANAGER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/profiles/profile_window.h" 10 #include "chrome/browser/profiles/profile_window.h"
11 #include "components/signin/core/browser/signin_metrics.h" 11 #include "components/signin/core/browser/signin_metrics.h"
12 #include "content/public/browser/web_contents_delegate.h"
12 13
13 namespace base { 14 namespace base {
14 class FilePath; 15 class FilePath;
15 } 16 }
16 17
17 // Cross-platform methods for displaying the user manager. 18 // Cross-platform methods for displaying the user manager.
18 class UserManager { 19 class UserManager {
19 public: 20 public:
20 // Shows the User Manager or re-activates an existing one, focusing the 21 // Shows the User Manager or re-activates an existing one, focusing the
21 // profile given by |profile_path_to_focus|; passing an empty base::FilePath 22 // profile given by |profile_path_to_focus|; passing an empty base::FilePath
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Dimensions of the reauth dialog displaying the old-style signin flow with 63 // Dimensions of the reauth dialog displaying the old-style signin flow with
63 // the username and password challenge on the same form. 64 // the username and password challenge on the same form.
64 static const int kPasswordCombinedReauthDialogHeight = 440; 65 static const int kPasswordCombinedReauthDialogHeight = 440;
65 static const int kPasswordCombinedReauthDialogWidth = 360; 66 static const int kPasswordCombinedReauthDialogWidth = 360;
66 67
67 // Dimensions of the reauth dialog displaying the password-separated signin 68 // Dimensions of the reauth dialog displaying the password-separated signin
68 // flow. 69 // flow.
69 static const int kReauthDialogHeight = 512; 70 static const int kReauthDialogHeight = 512;
70 static const int kReauthDialogWidth = 448; 71 static const int kReauthDialogWidth = 448;
71 72
72 // This class observes the WebUI used in the UserManager to perform online 73 // Abstract base class for performing online reauthentication of profiles in
73 // reauthentication of locked profiles. It is concretely implemented in 74 // the User Manager. It is concretely implemented in UserManagerMac and
74 // UserManagerMac and UserManagerView to specialize the closing of the UI's 75 // UserManagerView to specialize the closing of the UI's dialog widgets.
75 // dialog widget. 76 class BaseReauthDialogDelegate : virtual public content::WebContentsDelegate {
sky 2016/07/21 19:19:58 multiple inheritance is frowned upon, and diamond
76 class ReauthDialogObserver : public content::WebContentsObserver {
77 public: 77 public:
78 ReauthDialogObserver(content::WebContents* web_contents, 78 explicit BaseReauthDialogDelegate(content::WebContents* web_contents);
79 const std::string& email_address); 79
80 // content::WebContentsDelegate:
81 bool HandleContextMenu(const content::ContextMenuParams& params) override;
82
83 // content::WebContentsDelegate:
84 void LoadingStateChanged(content::WebContents* source,
85 bool to_different_document) override;
80 86
81 private: 87 private:
82 // content::WebContentsObserver:
83 void DidStopLoading() override;
84
85 virtual void CloseReauthDialog() = 0; 88 virtual void CloseReauthDialog() = 0;
86 89
87 const std::string email_address_; 90 content::WebContents* web_contents_;
88 91
89 DISALLOW_COPY_AND_ASSIGN(ReauthDialogObserver); 92 DISALLOW_COPY_AND_ASSIGN(BaseReauthDialogDelegate);
90 }; 93 };
91 94
92 private: 95 private:
93 DISALLOW_COPY_AND_ASSIGN(UserManager); 96 DISALLOW_COPY_AND_ASSIGN(UserManager);
94 }; 97 };
95 98
96 #endif // CHROME_BROWSER_UI_USER_MANAGER_H_ 99 #endif // CHROME_BROWSER_UI_USER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698