| 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 #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 | 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 22 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" | 22 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" |
| 23 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" | 23 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" |
| 24 #import "chrome/browser/cocoa/custom_home_pages_model.h" | 24 #import "chrome/browser/cocoa/custom_home_pages_model.h" |
| 25 #import "chrome/browser/cocoa/font_language_settings_controller.h" | 25 #import "chrome/browser/cocoa/font_language_settings_controller.h" |
| 26 #import "chrome/browser/cocoa/import_settings_dialog.h" | 26 #import "chrome/browser/cocoa/import_settings_dialog.h" |
| 27 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" | 27 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" |
| 28 #import "chrome/browser/cocoa/l10n_util.h" | 28 #import "chrome/browser/cocoa/l10n_util.h" |
| 29 #import "chrome/browser/cocoa/search_engine_list_model.h" | 29 #import "chrome/browser/cocoa/search_engine_list_model.h" |
| 30 #import "chrome/browser/cocoa/sync_customize_controller_cppsafe.h" | 30 #import "chrome/browser/cocoa/sync_customize_controller_cppsafe.h" |
| 31 #import "chrome/browser/cocoa/window_size_autosaver.h" |
| 31 #include "chrome/browser/download/download_manager.h" | 32 #include "chrome/browser/download/download_manager.h" |
| 32 #include "chrome/browser/extensions/extensions_service.h" | 33 #include "chrome/browser/extensions/extensions_service.h" |
| 33 #include "chrome/browser/metrics/metrics_service.h" | 34 #include "chrome/browser/metrics/metrics_service.h" |
| 34 #include "chrome/browser/metrics/user_metrics.h" | 35 #include "chrome/browser/metrics/user_metrics.h" |
| 35 #include "chrome/browser/net/dns_global.h" | 36 #include "chrome/browser/net/dns_global.h" |
| 36 #include "chrome/browser/net/url_fixer_upper.h" | 37 #include "chrome/browser/net/url_fixer_upper.h" |
| 37 #include "chrome/browser/options_window.h" | 38 #include "chrome/browser/options_window.h" |
| 38 #include "chrome/browser/pref_service.h" | 39 #include "chrome/browser/pref_service.h" |
| 39 #include "chrome/browser/profile.h" | 40 #include "chrome/browser/profile.h" |
| 40 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 41 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 underTheHoodContentSize = [underTheHoodContentView_ frame].size; | 645 underTheHoodContentSize = [underTheHoodContentView_ frame].size; |
| 645 | 646 |
| 646 // Put the Under the Hood content view into the scroller and scroll it to the | 647 // Put the Under the Hood content view into the scroller and scroll it to the |
| 647 // top. | 648 // top. |
| 648 [underTheHoodScroller_ setDocumentView:underTheHoodContentView_]; | 649 [underTheHoodScroller_ setDocumentView:underTheHoodContentView_]; |
| 649 [underTheHoodContentView_ scrollPoint: | 650 [underTheHoodContentView_ scrollPoint: |
| 650 NSMakePoint(0, underTheHoodContentSize.height)]; | 651 NSMakePoint(0, underTheHoodContentSize.height)]; |
| 651 | 652 |
| 652 [self switchToPage:initialPage_ animate:NO]; | 653 [self switchToPage:initialPage_ animate:NO]; |
| 653 | 654 |
| 654 // TODO(pinkerton): save/restore position based on prefs. | 655 // Save/restore position based on prefs. |
| 655 // http://crbug.com/34644 | 656 if (g_browser_process && g_browser_process->local_state()) { |
| 656 [[self window] center]; | 657 sizeSaver_.reset([[WindowSizeAutosaver alloc] |
| 658 initWithWindow:[self window] |
| 659 prefService:g_browser_process->local_state() |
| 660 path:prefs::kPreferencesWindowPlacement |
| 661 state:kSaveWindowRect]); |
| 662 } |
| 657 } | 663 } |
| 658 | 664 |
| 659 - (void)dealloc { | 665 - (void)dealloc { |
| 660 if (syncService_) { | 666 if (syncService_) { |
| 661 syncService_->RemoveObserver(observer_.get()); | 667 syncService_->RemoveObserver(observer_.get()); |
| 662 } | 668 } |
| 663 [customPagesSource_ removeObserver:self forKeyPath:@"customHomePages"]; | 669 [customPagesSource_ removeObserver:self forKeyPath:@"customHomePages"]; |
| 664 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 670 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 665 [self unregisterPrefObservers]; | 671 [self unregisterPrefObservers]; |
| 666 [animation_ setDelegate:nil]; | 672 [animation_ setDelegate:nil]; |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 case OPTIONS_PAGE_ADVANCED: | 1927 case OPTIONS_PAGE_ADVANCED: |
| 1922 return underTheHoodView_; | 1928 return underTheHoodView_; |
| 1923 case OPTIONS_PAGE_DEFAULT: | 1929 case OPTIONS_PAGE_DEFAULT: |
| 1924 case OPTIONS_PAGE_COUNT: | 1930 case OPTIONS_PAGE_COUNT: |
| 1925 LOG(DFATAL) << "Invalid page value " << page; | 1931 LOG(DFATAL) << "Invalid page value " << page; |
| 1926 } | 1932 } |
| 1927 return basicsView_; | 1933 return basicsView_; |
| 1928 } | 1934 } |
| 1929 | 1935 |
| 1930 @end | 1936 @end |
| OLD | NEW |