| Index: chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm b/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7e6218be23a3663f0cd9d139285ab670376c98bf
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm
|
| @@ -0,0 +1,63 @@
|
| +// 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.
|
| +
|
| +#import "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "base/strings/sys_string_conversions.h"
|
| +#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
|
| +#include "chrome/browser/ui/autofill/popup_constants.h"
|
| +#include "chrome/browser/ui/cocoa/autofill/password_generation_popup_view_bridge.h"
|
| +#include "components/autofill/core/browser/popup_item_ids.h"
|
| +#include "grit/ui_resources.h"
|
| +#include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/gfx/font_list.h"
|
| +#include "ui/gfx/image/image.h"
|
| +#include "ui/gfx/point.h"
|
| +#include "ui/gfx/rect.h"
|
| +
|
| +using autofill::PasswordGenerationPopupView;
|
| +
|
| +@interface PasswordGenerationPopupViewCocoa ()
|
| +@end
|
| +
|
| +@implementation PasswordGenerationPopupViewCocoa
|
| +
|
| +#pragma mark -
|
| +#pragma mark Initialisers
|
| +
|
| +- (id)initWithFrame:(NSRect)frame {
|
| + NOTREACHED();
|
| + return [self initWithController:NULL frame:frame];
|
| +}
|
| +
|
| +- (id)initWithController:(autofill::PasswordGenerationPopupController*)controller
|
| + frame:(NSRect)frame {
|
| + self = [super initWithAutofillPopupViewDelegate:controller frame:frame];
|
| + if (self)
|
| + controller_ = controller;
|
| +
|
| + return self;
|
| +}
|
| +
|
| +- (void)controllerDestroyed {
|
| + // Since the |controller_| either already has been destroyed or is about to
|
| + // be, about the only thing we can safely do with it is to null it out.
|
| + controller_ = NULL;
|
| +}
|
| +
|
| +#pragma mark -
|
| +#pragma mark NSView implementation:
|
| +
|
| +- (void)drawRect:(NSRect)dirtyRect {
|
| + // If the view is in the process of being destroyed, don't bother drawing.
|
| + if (!controller_)
|
| + return;
|
| +
|
| + [self drawBackgroundAndBorderInRect:dirtyRect];
|
| +
|
| + // FIXME: Draw more than just the background and border :-)
|
| +}
|
| +
|
| +@end
|
|
|