OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.appmenu; | 5 package org.chromium.chrome.browser.appmenu; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.content.res.TypedArray; | 9 import android.content.res.TypedArray; |
10 import android.graphics.Point; | 10 import android.graphics.Point; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 Point pt = new Point(); | 158 Point pt = new Point(); |
159 mActivity.getWindowManager().getDefaultDisplay().getSize(pt); | 159 mActivity.getWindowManager().getDefaultDisplay().getSize(pt); |
160 | 160 |
161 int footerResourceId = 0; | 161 int footerResourceId = 0; |
162 if (mDelegate.shouldShowFooter(appRect.height())) { | 162 if (mDelegate.shouldShowFooter(appRect.height())) { |
163 footerResourceId = mDelegate.getFooterResourceId(); | 163 footerResourceId = mDelegate.getFooterResourceId(); |
164 } | 164 } |
165 mAppMenu.show(wrapper, anchorView, isByPermanentButton, rotation, appRec
t, pt.y, | 165 mAppMenu.show(wrapper, anchorView, isByPermanentButton, rotation, appRec
t, pt.y, |
166 footerResourceId, mHighlightMenuId); | 166 footerResourceId, mHighlightMenuId); |
167 mAppMenuDragHelper.onShow(startDragging); | 167 mAppMenuDragHelper.onShow(startDragging); |
| 168 mDelegate.onShow(mAppMenu); |
168 setMenuHighlight(null); | 169 setMenuHighlight(null); |
169 RecordUserAction.record("MobileMenuShow"); | 170 RecordUserAction.record("MobileMenuShow"); |
170 return true; | 171 return true; |
171 } | 172 } |
172 | 173 |
173 void appMenuDismissed() { | 174 void appMenuDismissed() { |
174 mAppMenuDragHelper.finishDragging(); | 175 mAppMenuDragHelper.finishDragging(); |
175 } | 176 } |
176 | 177 |
177 /** | 178 /** |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 /** | 223 /** |
223 * Called by AppMenu to report that the App Menu visibility has changed. | 224 * Called by AppMenu to report that the App Menu visibility has changed. |
224 * @param isVisible Whether the App Menu is showing. | 225 * @param isVisible Whether the App Menu is showing. |
225 */ | 226 */ |
226 void onMenuVisibilityChanged(boolean isVisible) { | 227 void onMenuVisibilityChanged(boolean isVisible) { |
227 for (int i = 0; i < mObservers.size(); ++i) { | 228 for (int i = 0; i < mObservers.size(); ++i) { |
228 mObservers.get(i).onMenuVisibilityChanged(isVisible); | 229 mObservers.get(i).onMenuVisibilityChanged(isVisible); |
229 } | 230 } |
230 } | 231 } |
231 } | 232 } |
OLD | NEW |