Home | History | Annotate | Download | only in extensions
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_
      6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_
      7 #pragma once
      8 
      9 #include <vector>
     10 
     11 #import <Cocoa/Cocoa.h>
     12 
     13 #include "base/memory/scoped_nsobject.h"
     14 #include "base/string16.h"
     15 #include "chrome/browser/extensions/extension_install_ui.h"
     16 #include "third_party/skia/include/core/SkBitmap.h"
     17 
     18 class Extension;
     19 class Profile;
     20 
     21 // A controller for dialog to let the user install an extension. Created by
     22 // CrxInstaller.
     23 @interface ExtensionInstallDialogController : NSWindowController {
     24 @private
     25   IBOutlet NSImageView* iconView_;
     26   IBOutlet NSTextField* titleField_;
     27   IBOutlet NSTextField* subtitleField_;
     28   IBOutlet NSTextField* warningsField_;
     29   IBOutlet NSBox* warningsBox_;
     30   IBOutlet NSButton* cancelButton_;
     31   IBOutlet NSButton* okButton_;
     32 
     33   NSWindow* parentWindow_;  // weak
     34   Profile* profile_;  // weak
     35   ExtensionInstallUI::Delegate* delegate_;  // weak
     36 
     37   scoped_nsobject<NSString> title_;
     38   scoped_nsobject<NSString> warnings_;
     39   scoped_nsobject<NSString> button_;
     40   scoped_nsobject<NSString> subtitle_;
     41   SkBitmap icon_;
     42 }
     43 
     44 @property(nonatomic, readonly) NSImageView* iconView;
     45 @property(nonatomic, readonly) NSTextField* titleField;
     46 @property(nonatomic, readonly) NSTextField* subtitleField;
     47 @property(nonatomic, readonly) NSTextField* warningsField;
     48 @property(nonatomic, readonly) NSBox* warningsBox;
     49 @property(nonatomic, readonly) NSButton* cancelButton;
     50 @property(nonatomic, readonly) NSButton* okButton;
     51 
     52 - (id)initWithParentWindow:(NSWindow*)window
     53                    profile:(Profile*)profile
     54                  extension:(const Extension*)extension
     55                   delegate:(ExtensionInstallUI::Delegate*)delegate
     56                       icon:(SkBitmap*)bitmap
     57                   warnings:(const std::vector<string16>&)warnings
     58                       type:(ExtensionInstallUI::PromptType)type;
     59 - (void)runAsModalSheet;
     60 - (IBAction)cancel:(id)sender;
     61 - (IBAction)ok:(id)sender;
     62 
     63 @end
     64 
     65 #endif  // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLER_H_
     66