| 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/ui/cocoa/sidebar_controller.h" | 5 #import "chrome/browser/ui/cocoa/sidebar_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include <Cocoa/Cocoa.h> | 9 #include <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/sidebar/sidebar_manager.h" | 13 #include "chrome/browser/sidebar/sidebar_manager.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/ui/browser.h" | |
| 16 #import "chrome/browser/ui/cocoa/view_id_util.h" | 15 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 18 | 17 |
| 19 namespace { | 18 namespace { |
| 20 | 19 |
| 21 // By default sidebar width is 1/7th of the current page content width. | 20 // By default sidebar width is 1/7th of the current page content width. |
| 22 const CGFloat kDefaultSidebarWidthRatio = 1.0 / 7; | 21 const CGFloat kDefaultSidebarWidthRatio = 1.0 / 7; |
| 23 | 22 |
| 24 // Never make the web part of the tab contents smaller than this (needed if the | 23 // Never make the web part of the tab contents smaller than this (needed if the |
| 25 // window is only a few pixels wide). | 24 // window is only a few pixels wide). |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 - (BOOL)splitView:(NSSplitView *)splitView | 169 - (BOOL)splitView:(NSSplitView *)splitView |
| 171 shouldAdjustSizeOfSubview:(NSView *)subview { | 170 shouldAdjustSizeOfSubview:(NSView *)subview { |
| 172 // Return NO for the sidebar view to indicate that it should not be resized | 171 // Return NO for the sidebar view to indicate that it should not be resized |
| 173 // automatically. The sidebar keeps the width set by the user. | 172 // automatically. The sidebar keeps the width set by the user. |
| 174 if ([[splitView_ subviews] indexOfObject:subview] == 1) | 173 if ([[splitView_ subviews] indexOfObject:subview] == 1) |
| 175 return NO; | 174 return NO; |
| 176 return YES; | 175 return YES; |
| 177 } | 176 } |
| 178 | 177 |
| 179 @end | 178 @end |
| OLD | NEW |