OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <stack> | 5 #include <stack> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" | 7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/mac_util.h" | 12 #include "base/mac/mac_util.h" |
13 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
14 #include "chrome/browser/bookmarks/bookmark_model.h" | 14 #include "chrome/browser/bookmarks/bookmark_model.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.h" | 16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.h" |
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h" | 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h" |
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell.h" |
19 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 19 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
21 | 21 |
22 @interface BookmarkEditorBaseController () | 22 @interface BookmarkEditorBaseController () |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 @synthesize initialName = initialName_; | 155 @synthesize initialName = initialName_; |
156 @synthesize displayName = displayName_; | 156 @synthesize displayName = displayName_; |
157 @synthesize okEnabled = okEnabled_; | 157 @synthesize okEnabled = okEnabled_; |
158 | 158 |
159 - (id)initWithParentWindow:(NSWindow*)parentWindow | 159 - (id)initWithParentWindow:(NSWindow*)parentWindow |
160 nibName:(NSString*)nibName | 160 nibName:(NSString*)nibName |
161 profile:(Profile*)profile | 161 profile:(Profile*)profile |
162 parent:(const BookmarkNode*)parent | 162 parent:(const BookmarkNode*)parent |
163 configuration:(BookmarkEditor::Configuration)configuration { | 163 configuration:(BookmarkEditor::Configuration)configuration { |
164 NSString* nibpath = [mac_util::MainAppBundle() | 164 NSString* nibpath = [base::mac::MainAppBundle() |
165 pathForResource:nibName | 165 pathForResource:nibName |
166 ofType:@"nib"]; | 166 ofType:@"nib"]; |
167 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 167 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
168 parentWindow_ = parentWindow; | 168 parentWindow_ = parentWindow; |
169 profile_ = profile; | 169 profile_ = profile; |
170 parentNode_ = parent; | 170 parentNode_ = parent; |
171 configuration_ = configuration; | 171 configuration_ = configuration; |
172 initialName_ = [@"" retain]; | 172 initialName_ = [@"" retain]; |
173 observer_.reset(new BookmarkEditorBaseControllerBridge(self)); | 173 observer_.reset(new BookmarkEditorBaseControllerBridge(self)); |
174 [self bookmarkModel]->AddObserver(observer_.get()); | 174 [self bookmarkModel]->AddObserver(observer_.get()); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 } | 595 } |
596 | 596 |
597 // Implementing isEqual: allows the NSTreeController to preserve the selection | 597 // Implementing isEqual: allows the NSTreeController to preserve the selection |
598 // and open/shut state of outline items when the data changes. | 598 // and open/shut state of outline items when the data changes. |
599 - (BOOL)isEqual:(id)other { | 599 - (BOOL)isEqual:(id)other { |
600 return [other isKindOfClass:[BookmarkFolderInfo class]] && | 600 return [other isKindOfClass:[BookmarkFolderInfo class]] && |
601 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; | 601 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; |
602 } | 602 } |
603 | 603 |
604 @end | 604 @end |
OLD | NEW |