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