| 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 "ui/app_list/test/app_list_test_view_delegate.h" | 5 #include "ui/app_list/test/app_list_test_view_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/strings/utf_string_conversions.h" |
| 11 #include "ui/app_list/app_list_model.h" | 12 #include "ui/app_list/app_list_model.h" |
| 12 #include "ui/app_list/app_list_switches.h" | 13 #include "ui/app_list/app_list_switches.h" |
| 13 #include "ui/app_list/app_list_view_delegate_observer.h" | 14 #include "ui/app_list/app_list_view_delegate_observer.h" |
| 14 #include "ui/app_list/signin_delegate.h" | 15 #include "ui/app_list/signin_delegate.h" |
| 15 #include "ui/app_list/test/app_list_test_model.h" | 16 #include "ui/app_list/test/app_list_test_model.h" |
| 16 #include "ui/gfx/image/image_skia.h" | 17 #include "ui/gfx/image/image_skia.h" |
| 17 | 18 |
| 18 namespace app_list { | 19 namespace app_list { |
| 19 namespace test { | 20 namespace test { |
| 20 | 21 |
| 21 class TestSigninDelegate : public SigninDelegate { | 22 class TestSigninDelegate : public SigninDelegate { |
| 22 public: | 23 public: |
| 23 TestSigninDelegate() : signed_in_(true) {} | 24 TestSigninDelegate() : signed_in_(true) {} |
| 24 | 25 |
| 25 void set_signed_in(bool signed_in) { signed_in_ = signed_in; } | 26 void set_signed_in(bool signed_in) { signed_in_ = signed_in; } |
| 26 | 27 |
| 27 // SigninDelegate overrides: | 28 // SigninDelegate overrides: |
| 28 virtual bool NeedSignin() OVERRIDE { return !signed_in_; } | 29 virtual bool NeedSignin() OVERRIDE { return !signed_in_; } |
| 29 virtual void ShowSignin() OVERRIDE {} | 30 virtual void ShowSignin() OVERRIDE {} |
| 30 virtual void OpenLearnMore() OVERRIDE {} | 31 virtual void OpenLearnMore() OVERRIDE {} |
| 31 virtual void OpenSettings() OVERRIDE {} | 32 virtual void OpenSettings() OVERRIDE {} |
| 32 | 33 |
| 33 virtual base::string16 GetSigninHeading() OVERRIDE { | 34 virtual base::string16 GetSigninHeading() OVERRIDE { |
| 34 return base::string16(); | 35 return base::ASCIIToUTF16("Sign in Heading"); |
| 35 } | 36 } |
| 36 virtual base::string16 GetSigninText() OVERRIDE { return base::string16(); } | 37 virtual base::string16 GetSigninText() OVERRIDE { |
| 38 return base::ASCIIToUTF16("Placeholder text"); |
| 39 } |
| 37 virtual base::string16 GetSigninButtonText() OVERRIDE { | 40 virtual base::string16 GetSigninButtonText() OVERRIDE { |
| 38 return base::string16(); | 41 return base::ASCIIToUTF16("Sign in"); |
| 39 } | 42 } |
| 40 virtual base::string16 GetLearnMoreLinkText() OVERRIDE { | 43 virtual base::string16 GetLearnMoreLinkText() OVERRIDE { |
| 41 return base::string16(); | 44 return base::ASCIIToUTF16("Learn more"); |
| 42 } | 45 } |
| 43 virtual base::string16 GetSettingsLinkText() OVERRIDE { | 46 virtual base::string16 GetSettingsLinkText() OVERRIDE { |
| 44 return base::string16(); | 47 return base::ASCIIToUTF16("Settings"); |
| 45 } | 48 } |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 bool signed_in_; | 51 bool signed_in_; |
| 49 | 52 |
| 50 DISALLOW_COPY_AND_ASSIGN(TestSigninDelegate); | 53 DISALLOW_COPY_AND_ASSIGN(TestSigninDelegate); |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 AppListTestViewDelegate::AppListTestViewDelegate() | 56 AppListTestViewDelegate::AppListTestViewDelegate() |
| 54 : dismiss_count_(0), | 57 : dismiss_count_(0), |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 observers_.AddObserver(observer); | 147 observers_.AddObserver(observer); |
| 145 } | 148 } |
| 146 | 149 |
| 147 void AppListTestViewDelegate::RemoveObserver( | 150 void AppListTestViewDelegate::RemoveObserver( |
| 148 AppListViewDelegateObserver* observer) { | 151 AppListViewDelegateObserver* observer) { |
| 149 observers_.RemoveObserver(observer); | 152 observers_.RemoveObserver(observer); |
| 150 } | 153 } |
| 151 | 154 |
| 152 } // namespace test | 155 } // namespace test |
| 153 } // namespace app_list | 156 } // namespace app_list |
| OLD | NEW |