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 #import "chrome/browser/cocoa/preferences_window_controller.h" | 5 #import "chrome/browser/cocoa/preferences_window_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/l10n_util_mac.h" | 9 #include "app/l10n_util_mac.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 NSURL* path = [[panel URLs] lastObject]; // We only allow 1 item. | 1308 NSURL* path = [[panel URLs] lastObject]; // We only allow 1 item. |
1309 [self willChangeValueForKey:@"defaultDownloadLocation"]; | 1309 [self willChangeValueForKey:@"defaultDownloadLocation"]; |
1310 defaultDownloadLocation_.SetValue(base::SysNSStringToWide([path path])); | 1310 defaultDownloadLocation_.SetValue(base::SysNSStringToWide([path path])); |
1311 [self didChangeValueForKey:@"defaultDownloadLocation"]; | 1311 [self didChangeValueForKey:@"defaultDownloadLocation"]; |
1312 } | 1312 } |
1313 } | 1313 } |
1314 | 1314 |
1315 // Shows the cookies controller. | 1315 // Shows the cookies controller. |
1316 - (IBAction)showCookies:(id)sender { | 1316 - (IBAction)showCookies:(id)sender { |
1317 // The controller will clean itself up. | 1317 // The controller will clean itself up. |
| 1318 BrowsingDataLocalStorageHelper* storageHelper = |
| 1319 new BrowsingDataLocalStorageHelper(profile_); |
1318 CookiesWindowController* controller = | 1320 CookiesWindowController* controller = |
1319 [[CookiesWindowController alloc] initWithProfile:profile_]; | 1321 [[CookiesWindowController alloc] initWithProfile:profile_ |
| 1322 storageHelper:storageHelper]; |
1320 [controller attachSheetTo:[self window]]; | 1323 [controller attachSheetTo:[self window]]; |
1321 } | 1324 } |
1322 | 1325 |
1323 // Bring up an open panel to allow the user to set a new downloads location. | 1326 // Bring up an open panel to allow the user to set a new downloads location. |
1324 - (void)browseDownloadLocation:(id)sender { | 1327 - (void)browseDownloadLocation:(id)sender { |
1325 NSOpenPanel* panel = [NSOpenPanel openPanel]; | 1328 NSOpenPanel* panel = [NSOpenPanel openPanel]; |
1326 [panel setAllowsMultipleSelection:NO]; | 1329 [panel setAllowsMultipleSelection:NO]; |
1327 [panel setCanChooseFiles:NO]; | 1330 [panel setCanChooseFiles:NO]; |
1328 [panel setCanChooseDirectories:YES]; | 1331 [panel setCanChooseDirectories:YES]; |
1329 NSString* path = base::SysWideToNSString(defaultDownloadLocation_.GetValue()); | 1332 NSString* path = base::SysWideToNSString(defaultDownloadLocation_.GetValue()); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 case OPTIONS_PAGE_ADVANCED: | 1803 case OPTIONS_PAGE_ADVANCED: |
1801 return underTheHoodView_; | 1804 return underTheHoodView_; |
1802 case OPTIONS_PAGE_DEFAULT: | 1805 case OPTIONS_PAGE_DEFAULT: |
1803 case OPTIONS_PAGE_COUNT: | 1806 case OPTIONS_PAGE_COUNT: |
1804 LOG(DFATAL) << "Invalid page value " << page; | 1807 LOG(DFATAL) << "Invalid page value " << page; |
1805 } | 1808 } |
1806 return basicsView_; | 1809 return basicsView_; |
1807 } | 1810 } |
1808 | 1811 |
1809 @end | 1812 @end |
OLD | NEW |