Chromium Code Reviews| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 #include "ui/views/widget/native_widget.h" | 145 #include "ui/views/widget/native_widget.h" |
| 146 #include "ui/views/widget/root_view.h" | 146 #include "ui/views/widget/root_view.h" |
| 147 #include "ui/views/widget/widget.h" | 147 #include "ui/views/widget/widget.h" |
| 148 #include "ui/views/window/dialog_delegate.h" | 148 #include "ui/views/window/dialog_delegate.h" |
| 149 | 149 |
| 150 #if !defined(OS_CHROMEOS) | 150 #if !defined(OS_CHROMEOS) |
| 151 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 151 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 152 #endif | 152 #endif |
| 153 | 153 |
| 154 #if defined(USE_ASH) | 154 #if defined(USE_ASH) |
| 155 #include "ash/common/material_design/material_design_controller.h" | |
| 155 #include "chrome/browser/ui/ash/ash_util.h" | 156 #include "chrome/browser/ui/ash/ash_util.h" |
| 156 #endif | 157 #endif |
| 157 | 158 |
| 158 #if defined(USE_AURA) | 159 #if defined(USE_AURA) |
| 159 #include "ui/aura/client/window_parenting_client.h" | 160 #include "ui/aura/client/window_parenting_client.h" |
| 160 #include "ui/aura/window.h" | 161 #include "ui/aura/window.h" |
| 161 #include "ui/aura/window_tree_host.h" | 162 #include "ui/aura/window_tree_host.h" |
| 162 #endif | 163 #endif |
| 163 | 164 |
| 164 #if defined(OS_WIN) | 165 #if defined(OS_WIN) |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 // The background image starts tiling horizontally at the window left edge and | 520 // The background image starts tiling horizontally at the window left edge and |
| 520 // vertically at the top edge of the horizontal tab strip (or where it would | 521 // vertically at the top edge of the horizontal tab strip (or where it would |
| 521 // be). We expect our parent's origin to be the window origin. | 522 // be). We expect our parent's origin to be the window origin. |
| 522 gfx::Point window_point(point + GetMirroredPosition().OffsetFromOrigin()); | 523 gfx::Point window_point(point + GetMirroredPosition().OffsetFromOrigin()); |
| 523 window_point.Offset(frame_->GetThemeBackgroundXInset(), | 524 window_point.Offset(frame_->GetThemeBackgroundXInset(), |
| 524 -frame_->GetTopInset(false)); | 525 -frame_->GetTopInset(false)); |
| 525 return window_point; | 526 return window_point; |
| 526 } | 527 } |
| 527 | 528 |
| 528 bool BrowserView::IsTabStripVisible() const { | 529 bool BrowserView::IsTabStripVisible() const { |
| 529 if (immersive_mode_controller_->ShouldHideTopViews() && | 530 if (immersive_mode_controller_->ShouldHideTopViews()) { |
| 530 immersive_mode_controller_->ShouldHideTabIndicators()) { | 531 #if defined(USE_ASH) |
|
sky
2017/02/01 16:31:37
USE_ASH is now the same as OS_CHROMEOS and will ev
Qiang(Joe) Xu
2017/02/01 18:58:09
Done.
| |
| 531 return false; | 532 // For MD immersive fullscreen, tabstrip is considered as visible. Since top |
| 533 // container is off screen, tapstrip is still invisible to user. | |
| 534 if (ash::MaterialDesignController::IsImmersiveModeMaterial()) | |
|
sky
2017/02/01 16:31:37
Does it really matter whether md or not? I'm wonde
Qiang(Joe) Xu
2017/02/01 18:58:10
done, and I find IsImmersiveModeMaterial is equiva
| |
| 535 return true; | |
| 536 #endif | |
| 537 if (immersive_mode_controller_->ShouldHideTabIndicators()) | |
| 538 return false; | |
| 532 } | 539 } |
| 533 | 540 |
| 534 // Return false if this window does not normally display a tabstrip. | 541 // Return false if this window does not normally display a tabstrip. |
| 535 if (!browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP)) | 542 if (!browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP)) |
| 536 return false; | 543 return false; |
| 537 | 544 |
| 538 // Return false if the tabstrip has not yet been created (by InitViews()), | 545 // Return false if the tabstrip has not yet been created (by InitViews()), |
| 539 // since callers may otherwise try to access it. Note that we can't just check | 546 // since callers may otherwise try to access it. Note that we can't just check |
| 540 // this alone, as the tabstrip is created unconditionally even for windows | 547 // this alone, as the tabstrip is created unconditionally even for windows |
| 541 // that won't display it. | 548 // that won't display it. |
| (...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2643 } | 2650 } |
| 2644 | 2651 |
| 2645 extensions::ActiveTabPermissionGranter* | 2652 extensions::ActiveTabPermissionGranter* |
| 2646 BrowserView::GetActiveTabPermissionGranter() { | 2653 BrowserView::GetActiveTabPermissionGranter() { |
| 2647 content::WebContents* web_contents = GetActiveWebContents(); | 2654 content::WebContents* web_contents = GetActiveWebContents(); |
| 2648 if (!web_contents) | 2655 if (!web_contents) |
| 2649 return nullptr; | 2656 return nullptr; |
| 2650 return extensions::TabHelper::FromWebContents(web_contents) | 2657 return extensions::TabHelper::FromWebContents(web_contents) |
| 2651 ->active_tab_permission_granter(); | 2658 ->active_tab_permission_granter(); |
| 2652 } | 2659 } |
| OLD | NEW |