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

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: addressed review comments Created 9 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_titlebar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <cmath> 9 #include <cmath>
10 #include <numeric> 10 #include <numeric>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/mac/mac_util.h" 13 #include "base/mac/mac_util.h"
14 #import "base/memory/scoped_nsobject.h" 14 #import "base/memory/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/instant/instant_controller.h" 19 #include "chrome/browser/instant/instant_controller.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/profiles/profile_info_cache.h"
21 #include "chrome/browser/profiles/profile_manager.h" 22 #include "chrome/browser/profiles/profile_manager.h"
22 #include "chrome/browser/sync/profile_sync_service.h" 23 #include "chrome/browser/sync/profile_sync_service.h"
23 #include "chrome/browser/sync/sync_ui_util_mac.h" 24 #include "chrome/browser/sync/sync_ui_util_mac.h"
24 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" 25 #include "chrome/browser/tab_contents/tab_contents_view_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"
29 #include "chrome/browser/ui/browser_list.h" 30 #include "chrome/browser/ui/browser_list.h"
30 #import "chrome/browser/ui/cocoa/background_gradient_view.h" 31 #import "chrome/browser/ui/cocoa/background_gradient_view.h"
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 1347
1347 - (BOOL)isTabFullyVisible:(TabView*)tab { 1348 - (BOOL)isTabFullyVisible:(TabView*)tab {
1348 return [tabStripController_ isTabFullyVisible:tab]; 1349 return [tabStripController_ isTabFullyVisible:tab];
1349 } 1350 }
1350 1351
1351 - (void)showNewTabButton:(BOOL)show { 1352 - (void)showNewTabButton:(BOOL)show {
1352 [tabStripController_ showNewTabButton:show]; 1353 [tabStripController_ showNewTabButton:show];
1353 } 1354 }
1354 1355
1355 - (BOOL)shouldShowAvatar { 1356 - (BOOL)shouldShowAvatar {
1356 return [self hasTabStrip] && (browser_->profile()->IsOffTheRecord() || 1357 if (![self hasTabStrip])
1357 ProfileManager::IsMultipleProfilesEnabled()); 1358 return NO;
1359
1360 if (browser_->profile()->IsOffTheRecord())
1361 return YES;
1362
1363 if (ProfileManager::IsMultipleProfilesEnabled()) {
1364 // Show the profile avatar after the user has create more than one profile.
Robert Sesek 2011/08/03 21:13:00 createD?
sail 2011/08/03 21:17:14 Done.
1365 ProfileInfoCache& cache =
1366 g_browser_process->profile_manager()->GetProfileInfoCache();
1367 return cache.GetNumberOfProfiles() > 1;
1368 }
1369
1370 return NO;
1358 } 1371 }
1359 1372
1360 - (BOOL)isBookmarkBarVisible { 1373 - (BOOL)isBookmarkBarVisible {
1361 return [bookmarkBarController_ isVisible]; 1374 return [bookmarkBarController_ isVisible];
1362 } 1375 }
1363 1376
1364 - (BOOL)isBookmarkBarAnimating { 1377 - (BOOL)isBookmarkBarAnimating {
1365 return [bookmarkBarController_ isAnimationRunning]; 1378 return [bookmarkBarController_ isAnimationRunning];
1366 } 1379 }
1367 1380
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
2305 2318
2306 - (BOOL)supportsBookmarkBar { 2319 - (BOOL)supportsBookmarkBar {
2307 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 2320 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
2308 } 2321 }
2309 2322
2310 - (BOOL)isTabbedWindow { 2323 - (BOOL)isTabbedWindow {
2311 return browser_->is_type_tabbed(); 2324 return browser_->is_type_tabbed();
2312 } 2325 }
2313 2326
2314 @end // @implementation BrowserWindowController(WindowType) 2327 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/browser_titlebar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698