OLD | NEW |
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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 if (immersive_mode_controller_->ShouldHideTopViews() && | 541 if (immersive_mode_controller_->ShouldHideTopViews() && |
542 immersive_mode_controller_->ShouldHideTabIndicators()) | 542 immersive_mode_controller_->ShouldHideTabIndicators()) |
543 return false; | 543 return false; |
544 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 544 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
545 } | 545 } |
546 | 546 |
547 bool BrowserView::IsOffTheRecord() const { | 547 bool BrowserView::IsOffTheRecord() const { |
548 return browser_->profile()->IsOffTheRecord(); | 548 return browser_->profile()->IsOffTheRecord(); |
549 } | 549 } |
550 | 550 |
| 551 bool BrowserView::IsGuestSession() const { |
| 552 return browser_->profile()->IsGuestSession(); |
| 553 } |
| 554 |
| 555 bool BrowserView::IsRegularOrGuestSession() const { |
| 556 Profile* profile = browser_->profile(); |
| 557 return (profile->IsGuestSession() || !profile->IsOffTheRecord()); |
| 558 } |
| 559 |
551 int BrowserView::GetOTRIconResourceID() const { | 560 int BrowserView::GetOTRIconResourceID() const { |
552 int otr_resource_id = IDR_OTR_ICON; | 561 int otr_resource_id = IDR_OTR_ICON; |
553 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { | 562 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { |
554 if (IsFullscreen()) | 563 if (IsFullscreen()) |
555 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; | 564 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; |
556 #if defined(OS_WIN) | 565 #if defined(OS_WIN) |
557 if (win8::IsSingleWindowMetroMode()) | 566 if (win8::IsSingleWindowMetroMode()) |
558 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; | 567 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; |
559 #endif | 568 #endif |
560 } | 569 } |
561 | 570 |
562 return otr_resource_id; | 571 return otr_resource_id; |
563 } | 572 } |
564 | 573 |
565 bool BrowserView::IsGuestSession() const { | |
566 return browser_->profile()->IsGuestSession(); | |
567 } | |
568 | |
569 int BrowserView::GetGuestIconResourceID() const { | 574 int BrowserView::GetGuestIconResourceID() const { |
570 return IDR_GUEST_ICON; | 575 return IDR_GUEST_ICON; |
571 } | 576 } |
572 | 577 |
573 bool BrowserView::ShouldShowAvatar() const { | 578 bool BrowserView::ShouldShowAvatar() const { |
574 if (!IsBrowserTypeNormal()) | 579 if (!IsBrowserTypeNormal()) |
575 return false; | 580 return false; |
576 #if defined(OS_CHROMEOS) | 581 #if defined(OS_CHROMEOS) |
577 if (IsOffTheRecord() && !IsGuestSession()) | 582 if (IsOffTheRecord() && !IsGuestSession()) |
578 return true; | 583 return true; |
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2674 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2679 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
2675 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2680 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
2676 LocationBarView::kIconInternalPadding + 1); | 2681 LocationBarView::kIconInternalPadding + 1); |
2677 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2682 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
2678 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2683 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2679 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2684 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2680 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2685 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2681 } | 2686 } |
2682 return top_arrow_height; | 2687 return top_arrow_height; |
2683 } | 2688 } |
OLD | NEW |