- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / browser / edit_search_engine_cocoa_controller.h
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
3 // found in the LICENSE file.
4
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_
7
8 #import <Cocoa/Cocoa.h>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h"
12
13 class TemplateURL;
14
15 // 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 // otherwise it will modify the passed URL. A |delegate| is necessary to
18 // perform the actual database modifications, and should probably be an
19 // instance of KeywordEditorModelObserver.
20 @interface EditSearchEngineCocoaController :
21     NSWindowController<NSWindowDelegate> {
22   IBOutlet NSTextField* nameField_;
23   IBOutlet NSTextField* keywordField_;
24   IBOutlet NSTextField* urlField_;
25   IBOutlet NSImageView* nameImage_;
26   IBOutlet NSImageView* keywordImage_;
27   IBOutlet NSImageView* urlImage_;
28   IBOutlet NSButton* doneButton_;
29   IBOutlet NSTextField* urlDescriptionField_;
30   IBOutlet NSView* labelContainer_;
31   IBOutlet NSBox* fieldAndImageContainer_;
32
33   Profile* profile_;  // weak
34   TemplateURL* templateURL_;  // weak
35   scoped_ptr<EditSearchEngineController> controller_;
36 }
37
38 - (id)initWithProfile:(Profile*)profile
39              delegate:(EditSearchEngineControllerDelegate*)delegate
40           templateURL:(TemplateURL*)url;
41
42 - (IBAction)cancel:(id)sender;
43 - (IBAction)save:(id)sender;
44
45 @end
46
47 @interface EditSearchEngineCocoaController (ExposedForTesting)
48 - (BOOL)validateFields;
49 @end
50
51 #endif  // CHROME_BROWSER_UI_COCOA_BROWSER_EDIT_SEARCH_ENGINE_COCOA_CONTROLLER_H_