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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistorySheetContent.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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.app.Activity; 7 import android.support.v7.widget.Toolbar;
8 import android.view.View; 8 import android.view.View;
9 9
10 import org.chromium.chrome.browser.ChromeActivity;
11 import org.chromium.chrome.browser.toolbar.BottomToolbarPhone;
10 import org.chromium.chrome.browser.widget.BottomSheet.BottomSheetContent; 12 import org.chromium.chrome.browser.widget.BottomSheet.BottomSheetContent;
11 13
12 /** 14 /**
13 * A {@link BottomSheetContent} holding a {@link HistoryManager} for display in the BottomSheet. 15 * A {@link BottomSheetContent} holding a {@link HistoryManager} for display in the BottomSheet.
14 */ 16 */
15 public class HistorySheetContent implements BottomSheetContent { 17 public class HistorySheetContent implements BottomSheetContent {
16 private final View mContentView; 18 private final View mContentView;
19 private final Toolbar mToolbarView;
17 private HistoryManager mHistoryManager; 20 private HistoryManager mHistoryManager;
18 21
19 /** 22 /**
20 * @param activity The activity displaying the history manager UI. 23 * @param activity The activity displaying the history manager UI.
21 */ 24 */
22 public HistorySheetContent(Activity activity) { 25 public HistorySheetContent(ChromeActivity activity) {
23 mHistoryManager = new HistoryManager(activity, null); 26 mHistoryManager = new HistoryManager(activity, false);
24 mContentView = mHistoryManager.detachContentView(); 27 mContentView = mHistoryManager.getView();
28 mToolbarView = mHistoryManager.detachToolbarView();
29 ((BottomToolbarPhone) activity.getToolbarManager().getToolbar())
30 .setOtherToolbarStyle(mToolbarView);
25 } 31 }
26 32
27 @Override 33 @Override
28 public View getContentView() { 34 public View getContentView() {
29 return mContentView; 35 return mContentView;
30 } 36 }
31 37
32 @Override 38 @Override
33 public View getToolbarView() { 39 public View getToolbarView() {
34 return null; 40 return mToolbarView;
35 } 41 }
36 42
37 @Override 43 @Override
38 public int getVerticalScrollOffset() { 44 public int getVerticalScrollOffset() {
39 return mHistoryManager.getVerticalScrollOffset(); 45 return mHistoryManager.getVerticalScrollOffset();
40 } 46 }
41 47
42 @Override 48 @Override
43 public void destroy() { 49 public void destroy() {
44 mHistoryManager.onDestroyed(); 50 mHistoryManager.onDestroyed();
45 mHistoryManager = null; 51 mHistoryManager = null;
46 } 52 }
47 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698