| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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" |
| 11 #include "base/mac/bundle_locations.h" | 11 #include "base/mac/bundle_locations.h" |
| 12 #include "base/mac/mac_util.h" | 12 #include "base/mac/mac_util.h" |
| 13 #import "base/memory/scoped_nsobject.h" | 13 #import "base/memory/scoped_nsobject.h" |
| 14 #include "base/sys_string_conversions.h" | 14 #include "base/sys_string_conversions.h" |
| 15 #include "chrome/app/chrome_command_ids.h" // IDC_* | 15 #include "chrome/app/chrome_command_ids.h" // IDC_* |
| 16 #include "chrome/browser/bookmarks/bookmark_editor.h" | 16 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/instant/instant_controller.h" | 18 #include "chrome/browser/instant/instant_controller.h" |
| 19 #include "chrome/browser/managed_mode.h" |
| 19 #include "chrome/browser/profiles/avatar_menu_model.h" | 20 #include "chrome/browser/profiles/avatar_menu_model.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/profiles/profile_info_cache.h" | 22 #include "chrome/browser/profiles/profile_info_cache.h" |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
| 23 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
| 24 #include "chrome/browser/sync/sync_ui_util_mac.h" | 25 #include "chrome/browser/sync/sync_ui_util_mac.h" |
| 25 #include "chrome/browser/tabs/tab_strip_model.h" | 26 #include "chrome/browser/tabs/tab_strip_model.h" |
| 26 #include "chrome/browser/themes/theme_service.h" | 27 #include "chrome/browser/themes/theme_service.h" |
| 27 #include "chrome/browser/themes/theme_service_factory.h" | 28 #include "chrome/browser/themes/theme_service_factory.h" |
| 28 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
| (...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 return [tabStripController_ isTabFullyVisible:tab]; | 1398 return [tabStripController_ isTabFullyVisible:tab]; |
| 1398 } | 1399 } |
| 1399 | 1400 |
| 1400 - (void)showNewTabButton:(BOOL)show { | 1401 - (void)showNewTabButton:(BOOL)show { |
| 1401 [tabStripController_ showNewTabButton:show]; | 1402 [tabStripController_ showNewTabButton:show]; |
| 1402 } | 1403 } |
| 1403 | 1404 |
| 1404 - (BOOL)shouldShowAvatar { | 1405 - (BOOL)shouldShowAvatar { |
| 1405 if (![self hasTabStrip]) | 1406 if (![self hasTabStrip]) |
| 1406 return NO; | 1407 return NO; |
| 1407 if (browser_->profile()->IsOffTheRecord()) | 1408 if (browser_->profile()->IsOffTheRecord() || |
| 1409 ManagedMode::IsInManagedMode()) { |
| 1408 return YES; | 1410 return YES; |
| 1411 } |
| 1409 | 1412 |
| 1410 ProfileInfoCache& cache = | 1413 ProfileInfoCache& cache = |
| 1411 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1414 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 1412 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) == | 1415 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) == |
| 1413 std::string::npos) { | 1416 std::string::npos) { |
| 1414 return NO; | 1417 return NO; |
| 1415 } | 1418 } |
| 1416 | 1419 |
| 1417 return AvatarMenuModel::ShouldShowAvatarMenu(); | 1420 return AvatarMenuModel::ShouldShowAvatarMenu(); |
| 1418 } | 1421 } |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 | 2209 |
| 2207 - (BOOL)supportsBookmarkBar { | 2210 - (BOOL)supportsBookmarkBar { |
| 2208 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2211 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2209 } | 2212 } |
| 2210 | 2213 |
| 2211 - (BOOL)isTabbedWindow { | 2214 - (BOOL)isTabbedWindow { |
| 2212 return browser_->is_type_tabbed(); | 2215 return browser_->is_type_tabbed(); |
| 2213 } | 2216 } |
| 2214 | 2217 |
| 2215 @end // @implementation BrowserWindowController(WindowType) | 2218 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |