OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_IOS_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_IOS_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "components/toolbar/test_toolbar_model.h" |
| 14 #include "ios/chrome/browser/ui/toolbar/toolbar_model_ios.h" |
| 15 |
| 16 class TestToolbarModelIOS : public ToolbarModelIOS { |
| 17 public: |
| 18 TestToolbarModelIOS(); |
| 19 ~TestToolbarModelIOS() override; |
| 20 |
| 21 // ToolbarModelIOS implementation: |
| 22 ToolbarModel* GetToolbarModel() override; |
| 23 bool IsLoading() override; |
| 24 CGFloat GetLoadProgressFraction() override; |
| 25 bool CanGoBack() override; |
| 26 bool CanGoForward() override; |
| 27 bool IsCurrentTabNativePage() override; |
| 28 bool IsCurrentTabBookmarked() override; |
| 29 bool IsCurrentTabBookmarkedByUser() override; |
| 30 bool ShouldDisplayHintText() override; |
| 31 |
| 32 void set_is_loading(bool is_loading) { is_loading_ = is_loading; } |
| 33 void set_load_progress_fraction(CGFloat load_progress_fraction) { |
| 34 load_progress_fraction_ = load_progress_fraction; |
| 35 } |
| 36 void set_can_go_back(bool can_go_back) { can_go_back_ = can_go_back; } |
| 37 void set_can_go_forward(bool can_go_forward) { |
| 38 can_go_forward_ = can_go_forward; |
| 39 } |
| 40 void set_is_current_tab_native_page(bool is_current_tab_native_page) { |
| 41 is_current_tab_native_page_ = is_current_tab_native_page; |
| 42 } |
| 43 void set_is_current_tab_bookmarked(bool is_current_tab_bookmarked) { |
| 44 is_current_tab_bookmarked_ = is_current_tab_bookmarked; |
| 45 } |
| 46 |
| 47 private: |
| 48 std::unique_ptr<TestToolbarModel> test_toolbar_model_; |
| 49 bool is_loading_; |
| 50 CGFloat load_progress_fraction_; |
| 51 bool can_go_back_; |
| 52 bool can_go_forward_; |
| 53 bool is_current_tab_native_page_; |
| 54 bool is_current_tab_bookmarked_; |
| 55 }; |
| 56 |
| 57 #endif // IOS_CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_IOS_H_ |
OLD | NEW |