OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |