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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerToolbar.java

Issue 2751583002: 🏡 Show correct BottomSheetContent toolbar when contents swapped (Closed)
Patch Set: Remove duplicate "and" Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.history; 5 package org.chromium.chrome.browser.history;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.util.AttributeSet; 8 import android.util.AttributeSet;
9 import android.view.Menu; 9 import android.view.Menu;
10 import android.view.MenuItem; 10 import android.view.MenuItem;
(...skipping 18 matching lines...) Expand all
29 29
30 updateMenuItemVisibility(); 30 updateMenuItemVisibility();
31 } 31 }
32 32
33 /** 33 /**
34 * @param manager The {@link HistoryManager} associated with this toolbar. 34 * @param manager The {@link HistoryManager} associated with this toolbar.
35 */ 35 */
36 public void setManager(HistoryManager manager) { 36 public void setManager(HistoryManager manager) {
37 mManager = manager; 37 mManager = manager;
38 38
39 if (mManager.isDisplayedInNativePage()) { 39 if (!mManager.isDisplayedInSeparateActivity()) {
40 getMenu().removeItem(R.id.close_menu_id); 40 getMenu().removeItem(R.id.close_menu_id);
41 } 41 }
42 } 42 }
43 43
44 @Override 44 @Override
45 public void onSelectionStateChange(List<HistoryItem> selectedItems) { 45 public void onSelectionStateChange(List<HistoryItem> selectedItems) {
46 boolean wasSelectionEnabled = mIsSelectionEnabled; 46 boolean wasSelectionEnabled = mIsSelectionEnabled;
47 super.onSelectionStateChange(selectedItems); 47 super.onSelectionStateChange(selectedItems);
48 48
49 if (mIsSelectionEnabled) { 49 if (mIsSelectionEnabled) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (item.getItemId() == menuItemId) return item; 95 if (item.getItemId() == menuItemId) return item;
96 } 96 }
97 return null; 97 return null;
98 } 98 }
99 99
100 @VisibleForTesting 100 @VisibleForTesting
101 Menu getMenuForTests() { 101 Menu getMenuForTests() {
102 return getMenu(); 102 return getMenu();
103 } 103 }
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698