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

Unified Diff: chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h

Issue 11416047: Add mac UI for password generation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments and tests Created 8 years, 1 month 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
Index: chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
diff --git a/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..f63e3cdb9c9b81c319b9c2e098fd32544e297566
--- /dev/null
+++ b/chrome/browser/ui/cocoa/browser/password_generation_bubble_controller.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_BROWSER_PASSWORD_GENERATION_BUBBLE_CONTROLLER_H_
+#define CHROME_BROWSER_UI_COCOA_BROWSER_PASSWORD_GENERATION_BUBBLE_CONTROLLER_H_
+
+#import <Cocoa/Cocoa.h>
+
+#import "chrome/browser/ui/cocoa/base_bubble_controller.h"
+#import "chrome/browser/ui/cocoa/styled_text_field.h"
+#include "content/public/common/password_form.h"
+
+namespace autofill {
+class PasswordGenerator;
+}
+
+namespace content {
+class RenderViewHost;
+}
+
+class Browser;
+class PasswordManager;
+@class PasswordGenerationBubbleController;
+
+// Customized text field that is used to display the regenerate icon.
+@interface PasswordGenerationTextField : StyledTextField {
+}
+
+- (id)initWithFrame:(NSRect)frame
+ withController:(PasswordGenerationBubbleController*)controller
+ normalImage:(NSImage*)normalImage
+ hoverImage:(NSImage*)hoverImage;
+@end
+
+@interface PasswordGenerationBubbleController : BaseBubbleController {
+ @private
+ content::RenderViewHost* renderViewHost_;
+ PasswordManager* passwordManager_;
+ autofill::PasswordGenerator* passwordGenerator_;
+ content::PasswordForm form_;
+
+ PasswordGenerationTextField* textField_; // weak
+}
+
+- (id)initWithWindow:(NSWindow*)parentWindow
+ anchoredAt:(NSPoint)point
+ renderViewHost:(content::RenderViewHost*)renderViewHost
+ passwordManager:(PasswordManager*)passwordManager
+ usingGenerator:(autofill::PasswordGenerator*)passwordGenerator
+ forForm:(const content::PasswordForm&)form;
+- (void)performLayout;
+- (IBAction)fillPassword:(id)sender;
+- (void)regeneratePassword;
+@end
+
+@interface PasswordGenerationTextField (ExposedForTesting)
+- (NSRect)getIconFrame;
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_BROWSER_PASSWORD_GENERATION_BUBBLE_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698