OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.preferences; | 5 package org.chromium.chrome.browser.preferences; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Fragment; | 8 import android.app.Fragment; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.content.pm.ActivityInfo; | 10 import android.content.pm.ActivityInfo; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 @VisibleForTesting | 229 @VisibleForTesting |
230 public Fragment getFragmentForTest() { | 230 public Fragment getFragmentForTest() { |
231 return getFragmentManager().findFragmentById(android.R.id.content); | 231 return getFragmentManager().findFragmentById(android.R.id.content); |
232 } | 232 } |
233 | 233 |
234 @Override | 234 @Override |
235 public boolean onCreateOptionsMenu(Menu menu) { | 235 public boolean onCreateOptionsMenu(Menu menu) { |
236 super.onCreateOptionsMenu(menu); | 236 super.onCreateOptionsMenu(menu); |
237 // By default, every screen in Settings shows a "Help & feedback" menu i
tem. | 237 // By default, every screen in Settings shows a "Help & feedback" menu i
tem. |
238 MenuItem help = menu.add( | 238 MenuItem help = menu.add( |
239 Menu.NONE, R.id.menu_id_help_general, Menu.NONE, R.string.menu_h
elp); | 239 Menu.NONE, R.id.menu_id_help_general, Menu.CATEGORY_SECONDARY, R
.string.menu_help); |
240 help.setIcon(R.drawable.ic_help_and_feedback); | 240 help.setIcon(R.drawable.ic_help_and_feedback); |
241 return true; | 241 return true; |
242 } | 242 } |
243 | 243 |
244 @Override | 244 @Override |
245 public boolean onPrepareOptionsMenu(Menu menu) { | 245 public boolean onPrepareOptionsMenu(Menu menu) { |
246 if (menu.size() == 1) { | 246 if (menu.size() == 1) { |
247 MenuItem item = menu.getItem(0); | 247 MenuItem item = menu.getItem(0); |
248 if (item.getIcon() != null) item.setShowAsAction(MenuItem.SHOW_AS_AC
TION_IF_ROOM); | 248 if (item.getIcon() != null) item.setShowAsAction(MenuItem.SHOW_AS_AC
TION_IF_ROOM); |
249 } | 249 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // This must be called after setContentView(). | 284 // This must be called after setContentView(). |
285 // https://code.google.com/p/android/issues/detail?id=78819 | 285 // https://code.google.com/p/android/issues/detail?id=78819 |
286 ViewCompat.postOnAnimation(getWindow().getDecorView(), new Runnable() { | 286 ViewCompat.postOnAnimation(getWindow().getDecorView(), new Runnable() { |
287 @Override | 287 @Override |
288 public void run() { | 288 public void run() { |
289 setTheme(R.style.PreferencesTheme); | 289 setTheme(R.style.PreferencesTheme); |
290 } | 290 } |
291 }); | 291 }); |
292 } | 292 } |
293 } | 293 } |
OLD | NEW |