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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java

Issue 1243253004: Pass user gesture bit when chrome handles an intent fired by itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix findbugs warning Created 5 years, 4 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 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; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.ActivityManager; 8 import android.app.ActivityManager;
9 import android.app.SearchManager; 9 import android.app.SearchManager;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 private class InternalIntentDelegate implements IntentHandler.IntentHandlerD elegate { 612 private class InternalIntentDelegate implements IntentHandler.IntentHandlerD elegate {
613 613
614 /** 614 /**
615 * Processes a url view intent. 615 * Processes a url view intent.
616 * 616 *
617 * @param url The url from the intent. 617 * @param url The url from the intent.
618 */ 618 */
619 @Override 619 @Override
620 public void processUrlViewIntent(String url, String referer, String head ers, 620 public void processUrlViewIntent(String url, String referer, String head ers,
621 TabOpenType tabOpenType, String externalAppId, int tabIdToBringT oFront, 621 TabOpenType tabOpenType, String externalAppId, int tabIdToBringT oFront,
622 Intent intent) { 622 boolean hasUserGesture, Intent intent) {
623 TabModel tabModel = getCurrentTabModel(); 623 TabModel tabModel = getCurrentTabModel();
624 switch (tabOpenType) { 624 switch (tabOpenType) {
625 case REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB: 625 case REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB:
626 // Used by the bookmarks application. 626 // Used by the bookmarks application.
627 if (tabModel.getCount() > 0 && mUIInitialized 627 if (tabModel.getCount() > 0 && mUIInitialized
628 && mLayoutManager.overviewVisible()) { 628 && mLayoutManager.overviewVisible()) {
629 mLayoutManager.hideOverview(true); 629 mLayoutManager.hideOverview(true);
630 } 630 }
631 mTabModelSelectorImpl.tryToRestoreTabStateForUrl(url); 631 mTabModelSelectorImpl.tryToRestoreTabStateForUrl(url);
632 int tabToBeClobberedIndex = TabModelUtils.getTabIndexByUrl(t abModel, url); 632 int tabToBeClobberedIndex = TabModelUtils.getTabIndexByUrl(t abModel, url);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 break; 666 break;
667 case CLOBBER_CURRENT_TAB: 667 case CLOBBER_CURRENT_TAB:
668 // The browser triggered the intent. This happens when click ing links which 668 // The browser triggered the intent. This happens when click ing links which
669 // can be handled by other applications (e.g. www.youtube.co m links). 669 // can be handled by other applications (e.g. www.youtube.co m links).
670 ChromeTab currentTab = ChromeTab.fromTab(getActivityTab()); 670 ChromeTab currentTab = ChromeTab.fromTab(getActivityTab());
671 if (currentTab != null) { 671 if (currentTab != null) {
672 currentTab.getTabRedirectHandler().updateIntent(intent); 672 currentTab.getTabRedirectHandler().updateIntent(intent);
673 int transitionType = PageTransition.LINK | PageTransitio n.FROM_API; 673 int transitionType = PageTransition.LINK | PageTransitio n.FROM_API;
674 LoadUrlParams loadUrlParams = new LoadUrlParams(url, tra nsitionType); 674 LoadUrlParams loadUrlParams = new LoadUrlParams(url, tra nsitionType);
675 loadUrlParams.setIntentReceivedTimestamp(mIntentHandling TimeMs); 675 loadUrlParams.setIntentReceivedTimestamp(mIntentHandling TimeMs);
676 loadUrlParams.setHasUserGesture(hasUserGesture);
676 currentTab.loadUrl(loadUrlParams); 677 currentTab.loadUrl(loadUrlParams);
677 RecordUserAction.record("MobileTabClobbered"); 678 RecordUserAction.record("MobileTabClobbered");
678 } else { 679 } else {
679 launchIntent(url, referer, headers, externalAppId, true, intent); 680 launchIntent(url, referer, headers, externalAppId, true, intent);
680 } 681 }
681 break; 682 break;
682 case OPEN_NEW_TAB: 683 case OPEN_NEW_TAB:
683 launchIntent(url, referer, headers, externalAppId, true, int ent); 684 launchIntent(url, referer, headers, externalAppId, true, int ent);
684 RecordUserAction.record("MobileReceivedExternalIntent"); 685 RecordUserAction.record("MobileReceivedExternalIntent");
685 break; 686 break;
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 public void onOverviewModeFinishedShowing() {} 1311 public void onOverviewModeFinishedShowing() {}
1311 1312
1312 @Override 1313 @Override
1313 public void onOverviewModeStartedHiding(boolean showToolbar, boolean delayAn imation) {} 1314 public void onOverviewModeStartedHiding(boolean showToolbar, boolean delayAn imation) {}
1314 1315
1315 @Override 1316 @Override
1316 public void onOverviewModeFinishedHiding() { 1317 public void onOverviewModeFinishedHiding() {
1317 if (getAssistStatusHandler() != null) getAssistStatusHandler().updateAss istState(); 1318 if (getAssistStatusHandler() != null) getAssistStatusHandler().updateAss istState();
1318 } 1319 }
1319 } 1320 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698