OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
| 11 |
11 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" | 12 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" |
12 | 13 |
13 class TemplateURL; | 14 class TemplateURL; |
14 | 15 |
15 // This controller presents a dialog that allows a user to add or edit a search | 16 // This controller presents a dialog that allows a user to add or edit a search |
16 // engine. If constructed with a nil |templateURL| then it is an add operation, | 17 // engine. If constructed with a nil |templateURL| then it is an add operation, |
17 // otherwise it will modify the passed URL. A |delegate| is necessary to | 18 // otherwise it will modify the passed URL. A |delegate| is necessary to |
18 // perform the actual database modifications, and should probably be an | 19 // perform the actual database modifications, and should probably be an |
19 // instance of KeywordEditorModelObserver. | 20 // instance of KeywordEditorModelObserver. |
20 @interface EditSearchEngineCocoaController : | 21 @interface EditSearchEngineCocoaController : |
21 NSWindowController<NSWindowDelegate> { | 22 NSWindowController<NSWindowDelegate> { |
22 IBOutlet NSTextField* nameField_; | 23 IBOutlet NSTextField* nameField_; |
23 IBOutlet NSTextField* keywordField_; | 24 IBOutlet NSTextField* keywordField_; |
24 IBOutlet NSTextField* urlField_; | 25 IBOutlet NSTextField* urlField_; |
25 IBOutlet NSImageView* nameImage_; | 26 IBOutlet NSImageView* nameImage_; |
26 IBOutlet NSImageView* keywordImage_; | 27 IBOutlet NSImageView* keywordImage_; |
27 IBOutlet NSImageView* urlImage_; | 28 IBOutlet NSImageView* urlImage_; |
28 IBOutlet NSButton* doneButton_; | 29 IBOutlet NSButton* doneButton_; |
29 IBOutlet NSTextField* urlDescriptionField_; | 30 IBOutlet NSTextField* urlDescriptionField_; |
30 IBOutlet NSView* labelContainer_; | 31 IBOutlet NSView* labelContainer_; |
31 IBOutlet NSBox* fieldAndImageContainer_; | 32 IBOutlet NSBox* fieldAndImageContainer_; |
32 | 33 |
33 Profile* profile_; // weak | 34 Profile* profile_; // weak |
34 TemplateURL* templateURL_; // weak | 35 TemplateURL* templateURL_; // weak |
35 scoped_ptr<EditSearchEngineController> controller_; | 36 std::unique_ptr<EditSearchEngineController> controller_; |
36 } | 37 } |
37 | 38 |
38 - (id)initWithProfile:(Profile*)profile | 39 - (id)initWithProfile:(Profile*)profile |
39 delegate:(EditSearchEngineControllerDelegate*)delegate | 40 delegate:(EditSearchEngineControllerDelegate*)delegate |
40 templateURL:(TemplateURL*)url; | 41 templateURL:(TemplateURL*)url; |
41 | 42 |
42 - (IBAction)cancel:(id)sender; | 43 - (IBAction)cancel:(id)sender; |
43 - (IBAction)save:(id)sender; | 44 - (IBAction)save:(id)sender; |
44 | 45 |
45 @end | 46 @end |
46 | 47 |
47 @interface EditSearchEngineCocoaController (ExposedForTesting) | 48 @interface EditSearchEngineCocoaController (ExposedForTesting) |
48 - (BOOL)validateFields; | 49 - (BOOL)validateFields; |
49 @end | 50 @end |
50 | 51 |
51 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H
_ | 52 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H
_ |
OLD | NEW |