OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.chrome.browser.widget.findinpage; | 5 package org.chromium.chrome.browser.widget.findinpage; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.ColorStateList; | 8 import android.content.res.ColorStateList; |
9 import android.graphics.Color; | 9 import android.graphics.Color; |
10 import android.util.AttributeSet; | 10 import android.util.AttributeSet; |
(...skipping 26 matching lines...) Expand all Loading... |
37 public void deactivate(boolean clearSelection) { | 37 public void deactivate(boolean clearSelection) { |
38 super.deactivate(clearSelection); | 38 super.deactivate(clearSelection); |
39 setVisibility(View.GONE); | 39 setVisibility(View.GONE); |
40 } | 40 } |
41 | 41 |
42 @Override | 42 @Override |
43 protected void updateVisualsForTabModel(boolean isIncognito) { | 43 protected void updateVisualsForTabModel(boolean isIncognito) { |
44 int queryTextColorId; | 44 int queryTextColorId; |
45 if (isIncognito) { | 45 if (isIncognito) { |
46 setBackgroundResource(R.color.incognito_primary_color); | 46 setBackgroundResource(R.color.incognito_primary_color); |
47 ColorStateList white = getResources().getColorStateList(R.color.ligh
t_mode_tint); | 47 ColorStateList white = ApiCompatibilityUtils.getColorStateList(getRe
sources(), |
| 48 R.color.light_mode_tint); |
48 mFindNextButton.setTint(white); | 49 mFindNextButton.setTint(white); |
49 mFindPrevButton.setTint(white); | 50 mFindPrevButton.setTint(white); |
50 mCloseFindButton.setTint(white); | 51 mCloseFindButton.setTint(white); |
51 queryTextColorId = R.color.find_in_page_query_white_color; | 52 queryTextColorId = R.color.find_in_page_query_white_color; |
52 } else { | 53 } else { |
53 setBackgroundColor(Color.WHITE); | 54 setBackgroundColor(Color.WHITE); |
54 ColorStateList dark = getResources().getColorStateList(R.color.dark_
mode_tint); | 55 ColorStateList dark = ApiCompatibilityUtils.getColorStateList(getRes
ources(), |
| 56 R.color.dark_mode_tint); |
55 mFindNextButton.setTint(dark); | 57 mFindNextButton.setTint(dark); |
56 mFindPrevButton.setTint(dark); | 58 mFindPrevButton.setTint(dark); |
57 mCloseFindButton.setTint(dark); | 59 mCloseFindButton.setTint(dark); |
58 queryTextColorId = R.color.find_in_page_query_color; | 60 queryTextColorId = R.color.find_in_page_query_color; |
59 } | 61 } |
60 mFindQuery.setTextColor( | 62 mFindQuery.setTextColor( |
61 ApiCompatibilityUtils.getColor(getContext().getResources(), quer
yTextColorId)); | 63 ApiCompatibilityUtils.getColor(getContext().getResources(), quer
yTextColorId)); |
62 } | 64 } |
63 | 65 |
64 @Override | 66 @Override |
65 protected int getStatusColor(boolean failed, boolean incognito) { | 67 protected int getStatusColor(boolean failed, boolean incognito) { |
66 if (!failed && incognito) { | 68 if (!failed && incognito) { |
67 return ApiCompatibilityUtils.getColor(getContext().getResources(), | 69 return ApiCompatibilityUtils.getColor(getContext().getResources(), |
68 R.color.find_in_page_results_status_white_color); | 70 R.color.find_in_page_results_status_white_color); |
69 } | 71 } |
70 | 72 |
71 return super.getStatusColor(failed, incognito); | 73 return super.getStatusColor(failed, incognito); |
72 } | 74 } |
73 } | 75 } |
OLD | NEW |