| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 66 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 67 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 67 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 68 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" | 68 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" |
| 69 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 69 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 70 #include "chrome/common/chrome_switches.h" | 70 #include "chrome/common/chrome_switches.h" |
| 71 #include "chrome/common/url_constants.h" | 71 #include "chrome/common/url_constants.h" |
| 72 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 72 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 73 #include "content/public/browser/render_view_host.h" | 73 #include "content/public/browser/render_view_host.h" |
| 74 #include "content/public/browser/render_widget_host_view.h" | 74 #include "content/public/browser/render_widget_host_view.h" |
| 75 #include "content/public/browser/web_contents.h" | 75 #include "content/public/browser/web_contents.h" |
| 76 #include "content/public/common/content_switches.h" |
| 76 #include "grit/chromium_strings.h" | 77 #include "grit/chromium_strings.h" |
| 77 #include "grit/generated_resources.h" | 78 #include "grit/generated_resources.h" |
| 78 #include "grit/locale_settings.h" | 79 #include "grit/locale_settings.h" |
| 79 #include "ui/base/l10n/l10n_util.h" | 80 #include "ui/base/l10n/l10n_util.h" |
| 80 #include "ui/base/l10n/l10n_util_mac.h" | 81 #include "ui/base/l10n/l10n_util_mac.h" |
| 81 #include "ui/gfx/mac/scoped_ns_disable_screen_updates.h" | 82 #include "ui/gfx/mac/scoped_ns_disable_screen_updates.h" |
| 82 | 83 |
| 83 using l10n_util::GetStringUTF16; | 84 using l10n_util::GetStringUTF16; |
| 84 using l10n_util::GetNSStringWithFixup; | 85 using l10n_util::GetNSStringWithFixup; |
| 85 using l10n_util::GetNSStringFWithFixup; | 86 using l10n_util::GetNSStringFWithFixup; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { | 259 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { |
| 259 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 260 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
| 260 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { | 261 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { |
| 261 DCHECK(browser); | 262 DCHECK(browser); |
| 262 initializing_ = YES; | 263 initializing_ = YES; |
| 263 browser_.reset(browser); | 264 browser_.reset(browser); |
| 264 ownsBrowser_ = ownIt; | 265 ownsBrowser_ = ownIt; |
| 265 NSWindow* window = [self window]; | 266 NSWindow* window = [self window]; |
| 266 windowShim_.reset(new BrowserWindowCocoa(browser, self)); | 267 windowShim_.reset(new BrowserWindowCocoa(browser, self)); |
| 267 | 268 |
| 269 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 270 switches::kUseCoreAnimation)) |
| 271 [[[self window] contentView] setWantsLayer:YES]; |
| 272 |
| 268 // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. | 273 // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. |
| 269 // This has to happen before -enforceMinWindowSize: is called further down. | 274 // This has to happen before -enforceMinWindowSize: is called further down. |
| 270 NSSize minSize = [self isTabbedWindow] ? | 275 NSSize minSize = [self isTabbedWindow] ? |
| 271 NSMakeSize(400, 272) : NSMakeSize(100, 122); | 276 NSMakeSize(400, 272) : NSMakeSize(100, 122); |
| 272 [[self window] setMinSize:minSize]; | 277 [[self window] setMinSize:minSize]; |
| 273 | 278 |
| 274 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully | 279 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully |
| 275 // be big enough to hold all locks that'll ever be needed. | 280 // be big enough to hold all locks that'll ever be needed. |
| 276 barVisibilityLocks_.reset([[NSMutableSet setWithCapacity:10] retain]); | 281 barVisibilityLocks_.reset([[NSMutableSet setWithCapacity:10] retain]); |
| 277 | 282 |
| (...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2228 | 2233 |
| 2229 - (BOOL)supportsBookmarkBar { | 2234 - (BOOL)supportsBookmarkBar { |
| 2230 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2235 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2231 } | 2236 } |
| 2232 | 2237 |
| 2233 - (BOOL)isTabbedWindow { | 2238 - (BOOL)isTabbedWindow { |
| 2234 return browser_->is_type_tabbed(); | 2239 return browser_->is_type_tabbed(); |
| 2235 } | 2240 } |
| 2236 | 2241 |
| 2237 @end // @implementation BrowserWindowController(WindowType) | 2242 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |