| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_layout.h" | 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/ui/views/frame/browser_view.h" | 8 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" | 9 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" |
| 10 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" | 10 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 private: | 85 private: |
| 86 gfx::Size size_; | 86 gfx::Size size_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(MockView); | 88 DISALLOW_COPY_AND_ASSIGN(MockView); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 /////////////////////////////////////////////////////////////////////////////// | 91 /////////////////////////////////////////////////////////////////////////////// |
| 92 | 92 |
| 93 class MockImmersiveModeController : public ImmersiveModeController { | 93 class MockImmersiveModeController : public ImmersiveModeController { |
| 94 public: | 94 public: |
| 95 MockImmersiveModeController() {} | 95 MockImmersiveModeController() : ImmersiveModeController(Type::STUB) {} |
| 96 ~MockImmersiveModeController() override {} | 96 ~MockImmersiveModeController() override {} |
| 97 | 97 |
| 98 // ImmersiveModeController overrides: | 98 // ImmersiveModeController overrides: |
| 99 void Init(BrowserView* browser_view) override {} | 99 void Init(BrowserView* browser_view) override {} |
| 100 void SetEnabled(bool enabled) override {} | 100 void SetEnabled(bool enabled) override {} |
| 101 bool IsEnabled() const override { return false; } | 101 bool IsEnabled() const override { return false; } |
| 102 bool ShouldHideTabIndicators() const override { return false; } | 102 bool ShouldHideTabIndicators() const override { return false; } |
| 103 bool ShouldHideTopViews() const override { return false; } | 103 bool ShouldHideTopViews() const override { return false; } |
| 104 bool IsRevealed() const override { return false; } | 104 bool IsRevealed() const override { return false; } |
| 105 int GetTopContainerVerticalOffset( | 105 int GetTopContainerVerticalOffset( |
| 106 const gfx::Size& top_container_size) const override { | 106 const gfx::Size& top_container_size) const override { |
| 107 return 0; | 107 return 0; |
| 108 } | 108 } |
| 109 ImmersiveRevealedLock* GetRevealedLock(AnimateReveal animate_reveal) override | 109 ImmersiveRevealedLock* GetRevealedLock(AnimateReveal animate_reveal) override |
| 110 WARN_UNUSED_RESULT { | 110 WARN_UNUSED_RESULT { |
| 111 return nullptr; | 111 return nullptr; |
| 112 } | 112 } |
| 113 void OnFindBarVisibleBoundsChanged( | 113 void OnFindBarVisibleBoundsChanged( |
| 114 const gfx::Rect& new_visible_bounds) override {} | 114 const gfx::Rect& new_visible_bounds) override {} |
| 115 void SetupForTest() override {} | |
| 116 | 115 |
| 117 private: | 116 private: |
| 118 DISALLOW_COPY_AND_ASSIGN(MockImmersiveModeController); | 117 DISALLOW_COPY_AND_ASSIGN(MockImmersiveModeController); |
| 119 }; | 118 }; |
| 120 | 119 |
| 121 /////////////////////////////////////////////////////////////////////////////// | 120 /////////////////////////////////////////////////////////////////////////////// |
| 122 // Tests of BrowserViewLayout. Runs tests without constructing a BrowserView. | 121 // Tests of BrowserViewLayout. Runs tests without constructing a BrowserView. |
| 123 class BrowserViewLayoutTest : public BrowserWithTestWindowTest { | 122 class BrowserViewLayoutTest : public BrowserWithTestWindowTest { |
| 124 public: | 123 public: |
| 125 BrowserViewLayoutTest() | 124 BrowserViewLayoutTest() |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 const int kBottom = 500; | 250 const int kBottom = 500; |
| 252 EXPECT_EQ(kBottom, layout()->LayoutDownloadShelf(kBottom)); | 251 EXPECT_EQ(kBottom, layout()->LayoutDownloadShelf(kBottom)); |
| 253 | 252 |
| 254 // Download shelf layout moves up the bottom edge and sets visibility. | 253 // Download shelf layout moves up the bottom edge and sets visibility. |
| 255 delegate()->set_download_shelf_needs_layout(true); | 254 delegate()->set_download_shelf_needs_layout(true); |
| 256 download_shelf->SetVisible(false); | 255 download_shelf->SetVisible(false); |
| 257 EXPECT_EQ(450, layout()->LayoutDownloadShelf(kBottom)); | 256 EXPECT_EQ(450, layout()->LayoutDownloadShelf(kBottom)); |
| 258 EXPECT_TRUE(download_shelf->visible()); | 257 EXPECT_TRUE(download_shelf->visible()); |
| 259 EXPECT_EQ("0,450 0x50", download_shelf->bounds().ToString()); | 258 EXPECT_EQ("0,450 0x50", download_shelf->bounds().ToString()); |
| 260 } | 259 } |
| OLD | NEW |