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 #ifndef CHROME_BROWSER_UI_COCOA_SEARCH_ENGINE_LIST_MODEL_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_SEARCH_ENGINE_LIST_MODEL_H_ | |
7 #pragma once | |
8 | |
9 #import <Cocoa/Cocoa.h> | |
10 | |
11 #include "base/scoped_nsobject.h" | |
12 #include "base/scoped_ptr.h" | |
13 | |
14 class TemplateURLModel; | |
15 class SearchEngineObserver; | |
16 | |
17 // The model for the "default search engine" combobox in preferences. Bridges | |
18 // between the cross-platform TemplateURLModel and Cocoa while watching for | |
19 // changes to the cross-platform model. | |
20 | |
21 @interface SearchEngineListModel : NSObject { | |
22 @private | |
23 TemplateURLModel* model_; // weak, owned by Profile | |
24 scoped_ptr<SearchEngineObserver> observer_; // watches for model changes | |
25 scoped_nsobject<NSArray> engines_; | |
26 } | |
27 | |
28 // Initialize with the given template model. | |
29 - (id)initWithModel:(TemplateURLModel*)model; | |
30 | |
31 // Returns an array of NSString's corresponding to the user-visible names of the | |
32 // search engines. | |
33 - (NSArray*)searchEngines; | |
34 | |
35 // The index into |-searchEngines| of the current default search engine. If | |
36 // there is no default search engine, the value is -1. The setter changes the | |
37 // back-end preference. | |
38 - (NSInteger)defaultIndex; | |
39 - (void)setDefaultIndex:(NSInteger)index; | |
40 // Return TRUE if the default is managed via policy. | |
41 - (BOOL)isDefaultManaged; | |
42 @end | |
43 | |
44 // Broadcast when the cross-platform model changes. This can be used to update | |
45 // any view state that may rely on the position of items in the list. | |
46 extern NSString* const kSearchEngineListModelChangedNotification; | |
47 | |
48 #endif // CHROME_BROWSER_UI_COCOA_SEARCH_ENGINE_LIST_MODEL_H_ | |
OLD | NEW |