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

Side by Side Diff: chrome/browser/password_manager/chrome_password_manager_client.h

Issue 2947413002: Restrict CM API interface request and message dispatch. (Closed)
Patch Set: Reworked tests, added error handler in renderer. Created 3 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 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 static void BindCredentialManager( 129 static void BindCredentialManager(
130 const service_manager::BindSourceInfo& source_info, 130 const service_manager::BindSourceInfo& source_info,
131 password_manager::mojom::CredentialManagerRequest request, 131 password_manager::mojom::CredentialManagerRequest request,
132 content::RenderFrameHost* render_frame_host); 132 content::RenderFrameHost* render_frame_host);
133 133
134 // A helper method to determine whether a save/update bubble can be shown 134 // A helper method to determine whether a save/update bubble can be shown
135 // on this |url|. 135 // on this |url|.
136 static bool CanShowBubbleOnURL(const GURL& url); 136 static bool CanShowBubbleOnURL(const GURL& url);
137 137
138 // Exposed for testing.
vasilii 2017/06/29 11:59:59 Missing #if defined(UNIT_TEST)
engedy 2017/06/30 19:41:54 Done.
139 bool was_store_ever_called() const { return was_store_ever_called_; }
140 bool has_binding_for_credential_manager() const {
141 return credential_manager_impl_.HasBinding();
142 }
143
138 protected: 144 protected:
139 // Callable for tests. 145 // Callable for tests.
140 ChromePasswordManagerClient(content::WebContents* web_contents, 146 ChromePasswordManagerClient(content::WebContents* web_contents,
141 autofill::AutofillClient* autofill_client); 147 autofill::AutofillClient* autofill_client);
142 148
143 private: 149 private:
144 friend class content::WebContentsUserData<ChromePasswordManagerClient>; 150 friend class content::WebContentsUserData<ChromePasswordManagerClient>;
145 151
146 // content::WebContentsObserver overrides. 152 // content::WebContentsObserver overrides.
147 void DidStartNavigation( 153 void DidStartNavigation(
148 content::NavigationHandle* navigation_handle) override; 154 content::NavigationHandle* navigation_handle) override;
149 // TODO(crbug.com/706392): Fix password reuse detection for Android.
150 #if !defined(OS_ANDROID)
151 void DidFinishNavigation( 155 void DidFinishNavigation(
152 content::NavigationHandle* navigation_handle) override; 156 content::NavigationHandle* navigation_handle) override;
153 157
158 // TODO(crbug.com/706392): Fix password reuse detection for Android.
159 #if !defined(OS_ANDROID)
154 // content::RenderWidgetHost::InputEventObserver overrides. 160 // content::RenderWidgetHost::InputEventObserver overrides.
155 void OnInputEvent(const blink::WebInputEvent&) override; 161 void OnInputEvent(const blink::WebInputEvent&) override;
156 #endif 162 #endif
157 163
158 // Given |bounds| in the renderers coordinate system, return the same bounds 164 // Given |bounds| in the renderers coordinate system, return the same bounds
159 // in the screens coordinate system. 165 // in the screens coordinate system.
160 gfx::RectF GetBoundsInScreenSpace(const gfx::RectF& bounds); 166 gfx::RectF GetBoundsInScreenSpace(const gfx::RectF& bounds);
161 167
162 // Checks if the current page fulfils the conditions for the password manager 168 // Checks if the current page fulfils the conditions for the password manager
163 // to be active on it, for example Sync credentials are not saved or auto 169 // to be active on it, for example Sync credentials are not saved or auto
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 std::unique_ptr<password_manager::LogManager> log_manager_; 222 std::unique_ptr<password_manager::LogManager> log_manager_;
217 223
218 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the 224 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the
219 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. 225 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'.
220 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_; 226 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_;
221 227
222 // If set, this stores a ukm::SourceId that is bound to the last committed 228 // If set, this stores a ukm::SourceId that is bound to the last committed
223 // navigation of the tab owning this ChromePasswordManagerClient. 229 // navigation of the tab owning this ChromePasswordManagerClient.
224 base::Optional<ukm::SourceId> ukm_source_id_; 230 base::Optional<ukm::SourceId> ukm_source_id_;
225 231
232 // Whether navigator.credentials.store() was ever called from this
233 // WebContents. Used for testing.
234 bool was_store_ever_called_ = false;
235
226 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); 236 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient);
227 }; 237 };
228 238
229 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ 239 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698