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.widget.findinpage; | 5 package org.chromium.chrome.browser.widget.findinpage; |
6 | 6 |
7 import android.view.ActionMode; | 7 import android.view.ActionMode; |
8 import android.view.View; | 8 import android.view.View; |
9 import android.view.ViewStub; | 9 import android.view.ViewStub; |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 mFindToolbar.deactivate(clearSelection); | 58 mFindToolbar.deactivate(clearSelection); |
59 } | 59 } |
60 | 60 |
61 /** | 61 /** |
62 * Shows the toolbar if it's not already visible otherwise activates. | 62 * Shows the toolbar if it's not already visible otherwise activates. |
63 */ | 63 */ |
64 public void showToolbar() { | 64 public void showToolbar() { |
65 if (mFindToolbar == null) { | 65 if (mFindToolbar == null) { |
66 int stubId = R.id.find_toolbar_stub; | 66 int stubId = R.id.find_toolbar_stub; |
67 if (DeviceFormFactor.isTablet(mActivity)) { | 67 if (DeviceFormFactor.isTablet()) { |
68 stubId = R.id.find_toolbar_tablet_stub; | 68 stubId = R.id.find_toolbar_tablet_stub; |
69 } | 69 } |
70 mFindToolbar = (FindToolbar) ((ViewStub) mActivity.findViewById(stub
Id)).inflate(); | 70 mFindToolbar = (FindToolbar) ((ViewStub) mActivity.findViewById(stub
Id)).inflate(); |
71 mFindToolbar.setTabModelSelector(mActivity.getTabModelSelector()); | 71 mFindToolbar.setTabModelSelector(mActivity.getTabModelSelector()); |
72 mFindToolbar.setWindowAndroid(mActivity.getWindowAndroid()); | 72 mFindToolbar.setWindowAndroid(mActivity.getWindowAndroid()); |
73 if (mActivity.getBottomSheet() != null) mFindToolbar.disableHideKeyb
oardWhileFinding(); | 73 if (mActivity.getBottomSheet() != null) mFindToolbar.disableHideKeyb
oardWhileFinding(); |
74 mFindToolbar.setActionModeCallbackForTextEdit(mCallback); | 74 mFindToolbar.setActionModeCallbackForTextEdit(mCallback); |
75 mFindToolbar.setObserver(new FindToolbarObserver() { | 75 mFindToolbar.setObserver(new FindToolbarObserver() { |
76 @Override | 76 @Override |
77 public void onFindToolbarShown() { | 77 public void onFindToolbarShown() { |
(...skipping 21 matching lines...) Expand all Loading... |
99 mObservers.addObserver(observer); | 99 mObservers.addObserver(observer); |
100 } | 100 } |
101 | 101 |
102 /** | 102 /** |
103 * Remove an observer for find in page changes. | 103 * Remove an observer for find in page changes. |
104 */ | 104 */ |
105 public void removeObserver(FindToolbarObserver observer) { | 105 public void removeObserver(FindToolbarObserver observer) { |
106 mObservers.removeObserver(observer); | 106 mObservers.removeObserver(observer); |
107 } | 107 } |
108 } | 108 } |
OLD | NEW |