| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "grit/locale_settings.h" | 51 #include "grit/locale_settings.h" |
| 52 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 52 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| 53 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 53 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 std::string GetNewTabUIURLString() { | 57 std::string GetNewTabUIURLString() { |
| 58 return URLFixerUpper::FixupURL(chrome::kChromeUINewTabURL, std::string()); | 58 return URLFixerUpper::FixupURL(chrome::kChromeUINewTabURL, std::string()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Helper to remove all but the last view from the view heirarchy. | 61 // Helper to remove all but the last view from the view hierarchy. |
| 62 void RemoveAllButLastView(NSArray* views) { | 62 void RemoveAllButLastView(NSArray* views) { |
| 63 NSArray* toRemove = [views subarrayWithRange:NSMakeRange(0, [views count]-1)]; | 63 NSArray* toRemove = [views subarrayWithRange:NSMakeRange(0, [views count]-1)]; |
| 64 for (NSView* view in toRemove) { | 64 for (NSView* view in toRemove) { |
| 65 [view removeFromSuperviewWithoutNeedingDisplay]; | 65 [view removeFromSuperviewWithoutNeedingDisplay]; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Helper that sizes two buttons to fit in a row keeping their spacing, returns | 69 // Helper that sizes two buttons to fit in a row keeping their spacing, returns |
| 70 // the total horizontal size change. | 70 // the total horizontal size change. |
| 71 CGFloat SizeToFitButtonPair(NSButton* leftButton, NSButton* rightButton) { | 71 CGFloat SizeToFitButtonPair(NSButton* leftButton, NSButton* rightButton) { |
| (...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1958 case OPTIONS_PAGE_ADVANCED: | 1958 case OPTIONS_PAGE_ADVANCED: |
| 1959 return underTheHoodView_; | 1959 return underTheHoodView_; |
| 1960 case OPTIONS_PAGE_DEFAULT: | 1960 case OPTIONS_PAGE_DEFAULT: |
| 1961 case OPTIONS_PAGE_COUNT: | 1961 case OPTIONS_PAGE_COUNT: |
| 1962 LOG(DFATAL) << "Invalid page value " << page; | 1962 LOG(DFATAL) << "Invalid page value " << page; |
| 1963 } | 1963 } |
| 1964 return basicsView_; | 1964 return basicsView_; |
| 1965 } | 1965 } |
| 1966 | 1966 |
| 1967 @end | 1967 @end |
| OLD | NEW |