| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 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 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 class TemplateURL; |
| 8 |
| 9 #include "base/scoped_nsobject.h" |
| 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/browser/search_engines/edit_search_engine_controller.h" |
| 12 |
| 13 // This controller presents a dialog that allows a user to add or edit a search |
| 14 // engine. If constructed with a nil |templateURL| then it is an add operation, |
| 15 // otherwise it will modify the passed URL. A |delegate| is necessary to |
| 16 // perform the actual database modifications, and should probably be an |
| 17 // instance of KeywordEditorModelObserver. |
| 18 |
| 19 @interface EditSearchEngineCocoaController : NSWindowController { |
| 20 IBOutlet NSTextField* nameField_; |
| 21 IBOutlet NSTextField* keywordField_; |
| 22 IBOutlet NSTextField* urlField_; |
| 23 IBOutlet NSImageView* nameImage_; |
| 24 IBOutlet NSImageView* keywordImage_; |
| 25 IBOutlet NSImageView* urlImage_; |
| 26 IBOutlet NSButton* doneButton_; |
| 27 |
| 28 // Refs to the good and bad images used in the interface validation. |
| 29 scoped_nsobject<NSImage> goodImage_; |
| 30 scoped_nsobject<NSImage> badImage_; |
| 31 |
| 32 Profile* profile_; // weak |
| 33 const TemplateURL* templateURL_; // weak |
| 34 scoped_ptr<EditSearchEngineController> controller_; |
| 35 } |
| 36 |
| 37 - (id)initWithProfile:(Profile*)profile |
| 38 delegate:(EditSearchEngineControllerDelegate*)delegate |
| 39 templateURL:(const TemplateURL*)url; |
| 40 |
| 41 - (IBAction)cancel:(id)sender; |
| 42 - (IBAction)save:(id)sender; |
| 43 |
| 44 @end |
| 45 |
| 46 @interface EditSearchEngineCocoaController (ExposedForTesting) |
| 47 - (BOOL)validateFields; |
| 48 @end |
| OLD | NEW |