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