Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 7484040: Multi-Profiles: Only show the avatar icon if user has multiple profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
11 #import "base/memory/scoped_nsobject.h" 11 #import "base/memory/scoped_nsobject.h"
12 #include "base/sys_string_conversions.h" 12 #include "base/sys_string_conversions.h"
13 #include "chrome/app/chrome_command_ids.h" // IDC_* 13 #include "chrome/app/chrome_command_ids.h" // IDC_*
14 #include "chrome/browser/bookmarks/bookmark_editor.h" 14 #include "chrome/browser/bookmarks/bookmark_editor.h"
15 #include "chrome/browser/google/google_util.h" 15 #include "chrome/browser/google/google_util.h"
16 #include "chrome/browser/instant/instant_controller.h" 16 #include "chrome/browser/instant/instant_controller.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/profiles/profile_info_cache.h"
18 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
19 #include "chrome/browser/sync/profile_sync_service.h" 20 #include "chrome/browser/sync/profile_sync_service.h"
20 #include "chrome/browser/sync/sync_ui_util_mac.h" 21 #include "chrome/browser/sync/sync_ui_util_mac.h"
21 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" 22 #include "chrome/browser/tab_contents/tab_contents_view_mac.h"
22 #include "chrome/browser/tabs/tab_strip_model.h" 23 #include "chrome/browser/tabs/tab_strip_model.h"
23 #include "chrome/browser/themes/theme_service.h" 24 #include "chrome/browser/themes/theme_service.h"
24 #include "chrome/browser/themes/theme_service_factory.h" 25 #include "chrome/browser/themes/theme_service_factory.h"
25 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
26 #include "chrome/browser/ui/browser_list.h" 27 #include "chrome/browser/ui/browser_list.h"
27 #import "chrome/browser/ui/cocoa/background_gradient_view.h" 28 #import "chrome/browser/ui/cocoa/background_gradient_view.h"
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 } 1316 }
1316 1317
1317 - (BOOL)isTabFullyVisible:(TabView*)tab { 1318 - (BOOL)isTabFullyVisible:(TabView*)tab {
1318 return [tabStripController_ isTabFullyVisible:tab]; 1319 return [tabStripController_ isTabFullyVisible:tab];
1319 } 1320 }
1320 1321
1321 - (void)showNewTabButton:(BOOL)show { 1322 - (void)showNewTabButton:(BOOL)show {
1322 [tabStripController_ showNewTabButton:show]; 1323 [tabStripController_ showNewTabButton:show];
1323 } 1324 }
1324 1325
1325 - (BOOL)shouldShowAvatar { 1326 - (BOOL)shouldShowAvatar {
Robert Sesek 2011/07/24 13:56:37 Use YES/NO return values rather than true/false.
sail 2011/08/03 20:51:49 Done.
1326 return [self hasTabStrip] && (browser_->profile()->IsOffTheRecord() || 1327 if (![self hasTabStrip])
1327 ProfileManager::IsMultipleProfilesEnabled()); 1328 return false;
1329
1330 if (browser_->profile()->IsOffTheRecord())
1331 return true;
1332
1333 if (ProfileManager::IsMultipleProfilesEnabled()) {
1334 // Show the profile avatar after the user has create more than one profile.
1335 ProfileInfoCache& cache =
1336 g_browser_process->profile_manager()->GetProfileInfoCache();
1337 return cache.GetNumberOfProfiles() > 1;
1338 }
1339
1340 return false;
1328 } 1341 }
1329 1342
1330 - (BOOL)isBookmarkBarVisible { 1343 - (BOOL)isBookmarkBarVisible {
1331 return [bookmarkBarController_ isVisible]; 1344 return [bookmarkBarController_ isVisible];
1332 } 1345 }
1333 1346
1334 - (BOOL)isBookmarkBarAnimating { 1347 - (BOOL)isBookmarkBarAnimating {
1335 return [bookmarkBarController_ isAnimationRunning]; 1348 return [bookmarkBarController_ isAnimationRunning];
1336 } 1349 }
1337 1350
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 2202
2190 - (BOOL)supportsBookmarkBar { 2203 - (BOOL)supportsBookmarkBar {
2191 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2204 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2192 } 2205 }
2193 2206
2194 - (BOOL)isTabbedWindow { 2207 - (BOOL)isTabbedWindow {
2195 return browser_->is_type_tabbed(); 2208 return browser_->is_type_tabbed();
2196 } 2209 }
2197 2210
2198 @end // @implementation BrowserWindowController(WindowType) 2211 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_titlebar.cc » ('j') | chrome/browser/ui/views/frame/browser_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698