Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: chrome/android/java_staging/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarPhone.java

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java_staging/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarPhone.java
diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarPhone.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarPhone.java
new file mode 100644
index 0000000000000000000000000000000000000000..be41362a82b8444dd39bb177181f80c2186631c8
--- /dev/null
+++ b/chrome/android/java_staging/src/org/chromium/chrome/browser/widget/findinpage/FindToolbarPhone.java
@@ -0,0 +1,71 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.widget.findinpage;
+
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.google.android.apps.chrome.R;
+
+/**
+ * A phone specific version of the {@link FindToolbar}.
+ */
+public class FindToolbarPhone extends FindToolbar {
+ /**
+ * Creates an instance of a {@link FindToolbarPhone}.
+ * @param context The Context to create the {@link FindToolbarPhone} under.
+ * @param attrs The AttributeSet used to create the {@link FindToolbarPhone}.
+ */
+ public FindToolbarPhone(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void activate() {
+ if (!isViewAvailable()) return;
+ setVisibility(View.VISIBLE);
+ super.activate();
+ }
+
+ @Override
+ public void deactivate() {
+ super.deactivate();
+ setVisibility(View.GONE);
+ }
+
+ @Override
+ protected void updateVisualsForTabModel(boolean isIncognito) {
+ int queryTextColorId;
+ if (isIncognito) {
+ setBackgroundResource(R.color.incognito_primary_color);
+ ColorStateList white = getResources().getColorStateList(R.color.light_mode_tint);
+ mFindNextButton.setTint(white);
+ mFindPrevButton.setTint(white);
+ mCloseFindButton.setTint(white);
+ queryTextColorId = R.color.find_in_page_query_white_color;
+ } else {
+ setBackgroundColor(Color.WHITE);
+ ColorStateList dark = getResources().getColorStateList(R.color.dark_mode_tint);
+ mFindNextButton.setTint(dark);
+ mFindPrevButton.setTint(dark);
+ mCloseFindButton.setTint(dark);
+ queryTextColorId = R.color.find_in_page_query_color;
+ }
+ mFindQuery.setTextColor(getContext().getResources().getColor(queryTextColorId));
+ }
+
+ @Override
+ protected int getStatusColor(boolean failed, boolean incognito) {
+ if (!failed && incognito) {
+ return getContext().getResources().getColor(
+ R.color.find_in_page_results_status_white_color);
+ }
+
+ return super.getStatusColor(failed, incognito);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698