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.ntp; | 5 package org.chromium.chrome.browser.ntp; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
10 import android.graphics.Canvas; | 10 import android.graphics.Canvas; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 TraceEvent.end(TAG + ".initialize()"); | 289 TraceEvent.end(TAG + ".initialize()"); |
290 } | 290 } |
291 | 291 |
292 /** | 292 /** |
293 * Sets up the hint text and event handlers for the search box text view. | 293 * Sets up the hint text and event handlers for the search box text view. |
294 */ | 294 */ |
295 private void initializeSearchBoxTextView() { | 295 private void initializeSearchBoxTextView() { |
296 TraceEvent.begin(TAG + ".initializeSearchBoxTextView()"); | 296 TraceEvent.begin(TAG + ".initializeSearchBoxTextView()"); |
297 final TextView searchBoxTextView = (TextView) mSearchBoxView | 297 final TextView searchBoxTextView = (TextView) mSearchBoxView |
298 .findViewById(R.id.search_box_text); | 298 .findViewById(R.id.search_box_text); |
| 299 |
| 300 if (!ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SHOW_GOOGLE_G_IN_
OMNIBOX)) { |
| 301 // Not using the relative version of this call because we only want
to clear |
| 302 // the drawables. |
| 303 searchBoxTextView.setCompoundDrawables(null, null, null, null); |
| 304 } |
| 305 |
299 String hintText = getResources().getString(R.string.search_or_type_url); | 306 String hintText = getResources().getString(R.string.search_or_type_url); |
300 | |
301 if (!DeviceFormFactor.isTablet(getContext()) || mManager.isFakeOmniboxTe
xtEnabledTablet()) { | 307 if (!DeviceFormFactor.isTablet(getContext()) || mManager.isFakeOmniboxTe
xtEnabledTablet()) { |
302 searchBoxTextView.setHint(hintText); | 308 searchBoxTextView.setHint(hintText); |
303 } else { | 309 } else { |
304 searchBoxTextView.setContentDescription(hintText); | 310 searchBoxTextView.setContentDescription(hintText); |
305 } | 311 } |
306 searchBoxTextView.setOnClickListener(new View.OnClickListener() { | 312 searchBoxTextView.setOnClickListener(new View.OnClickListener() { |
307 @Override | 313 @Override |
308 public void onClick(View v) { | 314 public void onClick(View v) { |
309 mManager.focusSearchBox(false, null); | 315 mManager.focusSearchBox(false, null); |
310 } | 316 } |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 @Override | 854 @Override |
849 public void onLoadTaskAdded() { | 855 public void onLoadTaskAdded() { |
850 mPendingLoadTasks++; | 856 mPendingLoadTasks++; |
851 } | 857 } |
852 | 858 |
853 @Override | 859 @Override |
854 public void onLoadTaskCompleted() { | 860 public void onLoadTaskCompleted() { |
855 loadTaskCompleted(); | 861 loadTaskCompleted(); |
856 } | 862 } |
857 } | 863 } |
OLD | NEW |