| 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/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 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" |
| 11 #include "app/mac/scoped_nsdisable_screen_updates.h" | 11 #include "app/mac/scoped_nsdisable_screen_updates.h" |
| 12 #include "app/mac/nsimage_cache.h" | 12 #include "app/mac/nsimage_cache.h" |
| 13 #include "base/mac_util.h" | 13 #include "base/mac/mac_util.h" |
| 14 #import "base/scoped_nsobject.h" | 14 #import "base/scoped_nsobject.h" |
| 15 #include "base/sys_string_conversions.h" | 15 #include "base/sys_string_conversions.h" |
| 16 #include "chrome/app/chrome_command_ids.h" // IDC_* | 16 #include "chrome/app/chrome_command_ids.h" // IDC_* |
| 17 #include "chrome/browser/bookmarks/bookmark_editor.h" | 17 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 18 #include "chrome/browser/google/google_util.h" | 18 #include "chrome/browser/google/google_util.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 20 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 21 #include "chrome/browser/sync/profile_sync_service.h" | 21 #include "chrome/browser/sync/profile_sync_service.h" |
| 22 #include "chrome/browser/sync/sync_ui_util_mac.h" | 22 #include "chrome/browser/sync/sync_ui_util_mac.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // Takes ownership of |browser|. Note that the nib also sets this controller | 212 // Takes ownership of |browser|. Note that the nib also sets this controller |
| 213 // up as the window's delegate. | 213 // up as the window's delegate. |
| 214 - (id)initWithBrowser:(Browser*)browser { | 214 - (id)initWithBrowser:(Browser*)browser { |
| 215 return [self initWithBrowser:browser takeOwnership:YES]; | 215 return [self initWithBrowser:browser takeOwnership:YES]; |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Private(TestingAPI) init routine with testing options. | 218 // Private(TestingAPI) init routine with testing options. |
| 219 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { | 219 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { |
| 220 // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we | 220 // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we |
| 221 // can override it in a unit test. | 221 // can override it in a unit test. |
| 222 NSString* nibpath = [mac_util::MainAppBundle() | 222 NSString* nibpath = [base::mac::MainAppBundle() |
| 223 pathForResource:@"BrowserWindow" | 223 pathForResource:@"BrowserWindow" |
| 224 ofType:@"nib"]; | 224 ofType:@"nib"]; |
| 225 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 225 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
| 226 DCHECK(browser); | 226 DCHECK(browser); |
| 227 initializing_ = YES; | 227 initializing_ = YES; |
| 228 browser_.reset(browser); | 228 browser_.reset(browser); |
| 229 ownsBrowser_ = ownIt; | 229 ownsBrowser_ = ownIt; |
| 230 NSWindow* window = [self window]; | 230 NSWindow* window = [self window]; |
| 231 windowShim_.reset(new BrowserWindowCocoa(browser, self, window)); | 231 windowShim_.reset(new BrowserWindowCocoa(browser, self, window)); |
| 232 | 232 |
| (...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 | 2079 |
| 2080 - (BOOL)supportsBookmarkBar { | 2080 - (BOOL)supportsBookmarkBar { |
| 2081 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2081 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2082 } | 2082 } |
| 2083 | 2083 |
| 2084 - (BOOL)isNormalWindow { | 2084 - (BOOL)isNormalWindow { |
| 2085 return browser_->type() == Browser::TYPE_NORMAL; | 2085 return browser_->type() == Browser::TYPE_NORMAL; |
| 2086 } | 2086 } |
| 2087 | 2087 |
| 2088 @end // @implementation BrowserWindowController(WindowType) | 2088 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |