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.Resources; | 9 import android.content.res.Resources; |
10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 /** Opens the bookmarks page in the current tab. */ | 128 /** Opens the bookmarks page in the current tab. */ |
129 void navigateToBookmarks(); | 129 void navigateToBookmarks(); |
130 | 130 |
131 /** Opens the recent tabs page in the current tab. */ | 131 /** Opens the recent tabs page in the current tab. */ |
132 void navigateToRecentTabs(); | 132 void navigateToRecentTabs(); |
133 | 133 |
134 /** Opens a given URL in the current tab. */ | 134 /** Opens a given URL in the current tab. */ |
135 void open(String url); | 135 void open(String url); |
136 | 136 |
| 137 /** Opens the recent tabs page in the current tab. */ |
| 138 void navigateToInterests(); |
| 139 |
137 /** | 140 /** |
138 * Animates the search box up into the omnibox and bring up the keyboard
. | 141 * Animates the search box up into the omnibox and bring up the keyboard
. |
139 * @param beginVoiceSearch Whether to begin a voice search. | 142 * @param beginVoiceSearch Whether to begin a voice search. |
140 * @param pastedText Text to paste in the omnibox after it's been focuse
d. May be null. | 143 * @param pastedText Text to paste in the omnibox after it's been focuse
d. May be null. |
141 */ | 144 */ |
142 void focusSearchBox(boolean beginVoiceSearch, String pastedText); | 145 void focusSearchBox(boolean beginVoiceSearch, String pastedText); |
143 | 146 |
144 /** | 147 /** |
145 * Gets the list of most visited sites. | 148 * Gets the list of most visited sites. |
146 * @param observer The observer to be notified with the list of sites. | 149 * @param observer The observer to be notified with the list of sites. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 public void onClick(View v) { | 303 public void onClick(View v) { |
301 mManager.navigateToRecentTabs(); | 304 mManager.navigateToRecentTabs(); |
302 } | 305 } |
303 }); | 306 }); |
304 toolbar.getBookmarksButton().setOnClickListener(new View.OnClickListener
() { | 307 toolbar.getBookmarksButton().setOnClickListener(new View.OnClickListener
() { |
305 @Override | 308 @Override |
306 public void onClick(View v) { | 309 public void onClick(View v) { |
307 mManager.navigateToBookmarks(); | 310 mManager.navigateToBookmarks(); |
308 } | 311 } |
309 }); | 312 }); |
| 313 toolbar.getInterestsButton().setOnClickListener(new View.OnClickListener
() { |
| 314 @Override |
| 315 public void onClick(View v) { |
| 316 mManager.navigateToInterests(); |
| 317 } |
| 318 }); |
310 | 319 |
311 initializeSearchBoxScrollHandling(); | 320 initializeSearchBoxScrollHandling(); |
312 addOnLayoutChangeListener(this); | 321 addOnLayoutChangeListener(this); |
313 setSearchProviderHasLogo(searchProviderHasLogo); | 322 setSearchProviderHasLogo(searchProviderHasLogo); |
314 | 323 |
315 mPendingLoadTasks++; | 324 mPendingLoadTasks++; |
316 mManager.setMostVisitedURLsObserver(this, | 325 mManager.setMostVisitedURLsObserver(this, |
317 mMostVisitedDesign.getNumberOfTiles(searchProviderHasLogo)); | 326 mMostVisitedDesign.getNumberOfTiles(searchProviderHasLogo)); |
318 | 327 |
319 if (mManager.shouldShowOptOutPromo()) showOptOutPromo(); | 328 if (mManager.shouldShowOptOutPromo()) showOptOutPromo(); |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 } | 1107 } |
1099 } | 1108 } |
1100 } | 1109 } |
1101 | 1110 |
1102 @Override | 1111 @Override |
1103 public boolean preferLargeIcons() { | 1112 public boolean preferLargeIcons() { |
1104 return true; | 1113 return true; |
1105 } | 1114 } |
1106 } | 1115 } |
1107 } | 1116 } |
OLD | NEW |