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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 200483004: Show avatar icon on V2 app's frame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 579 }
580 580
581 return otr_resource_id; 581 return otr_resource_id;
582 } 582 }
583 583
584 int BrowserView::GetGuestIconResourceID() const { 584 int BrowserView::GetGuestIconResourceID() const {
585 return IDR_LOGIN_GUEST; 585 return IDR_LOGIN_GUEST;
586 } 586 }
587 587
588 bool BrowserView::ShouldShowAvatar() const { 588 bool BrowserView::ShouldShowAvatar() const {
589 if (!IsBrowserTypeNormal()) 589 #if defined(OS_CHROMEOS)
590 // Cros shows the avatar on both browser and v1 app.
591 if (!browser_->is_type_tabbed() && !browser_->is_app())
590 return false; 592 return false;
591 #if defined(OS_CHROMEOS) 593 // Don't show incognito avatar in the geust session.
592 if (IsOffTheRecord() && !IsGuestSession()) 594 if (IsOffTheRecord() && !IsGuestSession())
593 return true; 595 return true;
594 // This function is called via BrowserNonClientFrameView::UpdateAvatarInfo 596 // This function is called via BrowserNonClientFrameView::UpdateAvatarInfo
595 // during the creation of the BrowserWindow, so browser->window() will not 597 // during the creation of the BrowserWindow, so browser->window() will not
596 // yet be set. In this case we can safely return false. 598 // yet be set. In this case we can safely return false.
597 if (!browser_->window()) 599 if (!browser_->window())
598 return false; 600 return false;
599 return chrome::MultiUserWindowManager::ShouldShowAvatar( 601 return chrome::MultiUserWindowManager::ShouldShowAvatar(
600 browser_->window()->GetNativeWindow()); 602 browser_->window()->GetNativeWindow());
601 #else 603 #else
604 if (!IsBrowserTypeNormal())
605 return false;
602 if (IsOffTheRecord()) // Desktop guest is incognito and needs avatar. 606 if (IsOffTheRecord()) // Desktop guest is incognito and needs avatar.
603 return true; 607 return true;
604 // Tests may not have a profile manager. 608 // Tests may not have a profile manager.
605 if (!g_browser_process->profile_manager()) 609 if (!g_browser_process->profile_manager())
606 return false; 610 return false;
607 ProfileInfoCache& cache = 611 ProfileInfoCache& cache =
608 g_browser_process->profile_manager()->GetProfileInfoCache(); 612 g_browser_process->profile_manager()->GetProfileInfoCache();
609 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) == 613 if (cache.GetIndexOfProfileWithPath(browser_->profile()->GetPath()) ==
610 std::string::npos) { 614 std::string::npos) {
611 return false; 615 return false;
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2558 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2562 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2559 gfx::Point icon_bottom( 2563 gfx::Point icon_bottom(
2560 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2564 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2561 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2565 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2562 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2566 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2563 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2567 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2564 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2568 top_arrow_height = infobar_top.y() - icon_bottom.y();
2565 } 2569 }
2566 return top_arrow_height; 2570 return top_arrow_height;
2567 } 2571 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698