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.webapps; | 5 package org.chromium.chrome.browser.webapps; |
6 | 6 |
7 import android.content.Intent; | 7 import android.content.Intent; |
8 import android.util.Pair; | 8 import android.util.Pair; |
9 import android.view.View; | 9 import android.view.View; |
10 import android.view.ViewGroup; | 10 import android.view.ViewGroup; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 mWebContentsObserver.destroy(); | 162 mWebContentsObserver.destroy(); |
163 mWebContentsObserver = null; | 163 mWebContentsObserver = null; |
164 } | 164 } |
165 | 165 |
166 mWebContents = webContents; | 166 mWebContents = webContents; |
167 if (mWebContents == null) return; | 167 if (mWebContents == null) return; |
168 | 168 |
169 ContentViewCore.fromWebContents(webContents).setFullscreenRequiredForOri
entationLock(false); | 169 ContentViewCore.fromWebContents(webContents).setFullscreenRequiredForOri
entationLock(false); |
170 mWebContentsObserver = new WebContentsObserver(webContents) { | 170 mWebContentsObserver = new WebContentsObserver(webContents) { |
171 @Override | 171 @Override |
172 public void didCommitProvisionalLoadForFrame( | 172 public void didFinishNavigation(String url, boolean isInMainFrame, b
oolean isErrorPage, |
173 long frameId, boolean isMainFrame, String url, int transitio
nType) { | 173 boolean hasCommitted, boolean isSamePage, boolean isFragment
Navigation, |
174 if (!isMainFrame) return; | 174 Integer pageTransition, int errorCode, int httpStatusCode) { |
175 // Notify the renderer to permanently hide the top controls sinc
e they do | 175 if (hasCommitted && isInMainFrame) { |
176 // not apply to fullscreen content views. | 176 // Notify the renderer to permanently hide the top controls
since they do |
177 mTab.updateBrowserControlsState(mTab.getBrowserControlsStateCons
traints(), true); | 177 // not apply to fullscreen content views. |
| 178 mTab.updateBrowserControlsState( |
| 179 mTab.getBrowserControlsStateConstraints(), true); |
| 180 } |
178 } | 181 } |
179 }; | 182 }; |
180 } | 183 } |
181 | 184 |
182 /** | 185 /** |
183 * @return {@link TabDelegateFactory} to be used while creating the associat
ed {@link Tab}. | 186 * @return {@link TabDelegateFactory} to be used while creating the associat
ed {@link Tab}. |
184 */ | 187 */ |
185 protected TabDelegateFactory createTabDelegateFactory() { | 188 protected TabDelegateFactory createTabDelegateFactory() { |
186 return new FullScreenDelegateFactory(); | 189 return new FullScreenDelegateFactory(); |
187 } | 190 } |
(...skipping 12 matching lines...) Expand all Loading... |
200 mTab.goBack(); | 203 mTab.goBack(); |
201 return true; | 204 return true; |
202 } | 205 } |
203 return false; | 206 return false; |
204 } | 207 } |
205 | 208 |
206 @Override | 209 @Override |
207 public void onCheckForUpdate(boolean updateAvailable) { | 210 public void onCheckForUpdate(boolean updateAvailable) { |
208 } | 211 } |
209 } | 212 } |
OLD | NEW |