OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_COCOA_CUSTOM_HOME_PAGES_MODEL_H_ | 5 #ifndef CHROME_BROWSER_COCOA_CUSTOM_HOME_PAGES_MODEL_H_ |
6 #define CHROME_BROWSER_COCOA_CUSTOM_HOME_PAGES_MODEL_H_ | 6 #define CHROME_BROWSER_COCOA_CUSTOM_HOME_PAGES_MODEL_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 | 13 |
14 class Profile; | 14 class Profile; |
15 | 15 |
16 // The model for the "custom home pages" table in preferences. Contains a list | 16 // The model for the "custom home pages" table in preferences. Contains a list |
17 // of CustomHomePageEntry objects. This is intended to be used with Cocoa | 17 // of CustomHomePageEntry objects. This is intended to be used with Cocoa |
18 // bindings. | 18 // bindings. |
19 // | 19 // |
20 // The supported binding is |customHomePages|, a to-many relationship which | 20 // The supported binding is |customHomePages|, a to-many relationship which |
21 // can be observed with an array controller. | 21 // can be observed with an array controller. |
22 | 22 |
23 @interface CustomHomePagesModel : NSObject { | 23 @interface CustomHomePagesModel : NSObject { |
24 @private | 24 @private |
25 scoped_nsobject<NSArray> entries_; | 25 scoped_nsobject<NSMutableArray> entries_; |
26 Profile* profile_; // weak, used for loading favicons | 26 Profile* profile_; // weak, used for loading favicons |
27 } | 27 } |
28 | 28 |
29 // Initialize with |profile|, which must not be NULL. The profile is used for | 29 // Initialize with |profile|, which must not be NULL. The profile is used for |
30 // loading favicons for urls. | 30 // loading favicons for urls. |
31 - (id)initWithProfile:(Profile*)profile; | 31 - (id)initWithProfile:(Profile*)profile; |
32 | 32 |
33 // Get/set the urls the model currently contains as a group. Only one change | 33 // Get/set the urls the model currently contains as a group. Only one change |
34 // notification will be sent. | 34 // notification will be sent. |
35 - (std::vector<GURL>)URLs; | 35 - (std::vector<GURL>)URLs; |
(...skipping 20 matching lines...) Expand all Loading... |
56 @end | 56 @end |
57 | 57 |
58 // A notification that fires when the URL of one of the entries changes. | 58 // A notification that fires when the URL of one of the entries changes. |
59 // Prevents interested parties from having to observe all model objects in order | 59 // Prevents interested parties from having to observe all model objects in order |
60 // to persist changes to a single entry. Changes to the number of items in the | 60 // to persist changes to a single entry. Changes to the number of items in the |
61 // model can be observed by watching |customHomePages| via KVO so an additional | 61 // model can be observed by watching |customHomePages| via KVO so an additional |
62 // notification is not sent. | 62 // notification is not sent. |
63 extern NSString* const kHomepageEntryChangedNotification; | 63 extern NSString* const kHomepageEntryChangedNotification; |
64 | 64 |
65 #endif // CHROME_BROWSER_COCOA_CUSTOM_HOME_PAGES_MODEL_H_ | 65 #endif // CHROME_BROWSER_COCOA_CUSTOM_HOME_PAGES_MODEL_H_ |
OLD | NEW |