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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 7155015: Store profile avatar to preferences (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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_view.cc (revision 91576)
+++ chrome/browser/ui/views/frame/browser_view.cc (working copy)
@@ -29,6 +29,8 @@
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/sidebar/sidebar_container.h"
@@ -466,9 +468,19 @@
}
bool BrowserView::ShouldShowAvatar() const {
- return IsBrowserTypeNormal() &&
- (IsOffTheRecord() ||
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles));
+ if (!IsBrowserTypeNormal())
+ return false;
+ if (IsOffTheRecord())
+ return true;
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles)) {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ if (cache.GetNumberOfProfiles() > 1)
+ return true;
+ }
+
+ return false;
}
bool BrowserView::AcceleratorPressed(const views::Accelerator& accelerator) {
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.cc ('k') | chrome/browser/ui/views/frame/glass_browser_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698