diff options
author | iannucci@google.com <iannucci@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-21 01:05:13 +0000 |
---|---|---|
committer | iannucci@google.com <iannucci@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-21 01:05:13 +0000 |
commit | f2aafb5ab3ad59cdd39a00890458e0ba320756f3 (patch) | |
tree | 87e24a5b08045973ea2d82d8838604ff72fecb0c | |
parent | 9c2ebfa63a5df98c3781ff16e3042b006f4ff38e (diff) | |
download | chromium_src-f2aafb5ab3ad59cdd39a00890458e0ba320756f3.zip chromium_src-f2aafb5ab3ad59cdd39a00890458e0ba320756f3.tar.gz chromium_src-f2aafb5ab3ad59cdd39a00890458e0ba320756f3.tar.bz2 |
Revert "Adding the extension matching mechanism"
This reverts commit af87d31a117bb0a5a117f5565375738e4c490b52 (aka r177833).
This was failing RefocusFilterLaunch on chromeos:
http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%282%29/builds/11067
TBR=skuhne@chromium.org
Review URL: https://codereview.chromium.org/12040003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177881 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc | 25 | ||||
-rw-r--r-- | chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc | 5 |
2 files changed, 12 insertions, 18 deletions
diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc index 5c7f11c..a92f53a 100644 --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc @@ -141,9 +141,6 @@ AppShortcutLauncherItemController::GetRunningApplications() { refocus_pattern.Parse(refocus_url_.spec()); } - const Extension* extension = - launcher_controller()->GetExtensionForAppID(app_id()); - for (BrowserList::const_reverse_iterator it = BrowserList::begin_last_active(); it != BrowserList::end_last_active(); ++it) { @@ -155,17 +152,17 @@ AppShortcutLauncherItemController::GetRunningApplications() { content::WebContents* web_contents = tab_strip->GetWebContentsAt( (index + active_index) % tab_strip->count()); const GURL tab_url = web_contents->GetURL(); - // There are three ways to identify the association of a URL with this - // extension: - // - The refocus pattern is matched (needed for apps like drive). - // - The extension's origin + extent gets matched. - // - The launcher controller knows that the tab got created for this app. - if ((!refocus_pattern.match_all_urls() && - refocus_pattern.MatchesURL(tab_url)) || - (extension->OverlapsWithOrigin(tab_url) && - extension->web_extent().MatchesURL(tab_url)) || - launcher_controller()->GetPerAppInterface()-> - IsWebContentHandledByApplication(web_contents, app_id())) + // The following cases are a successful application identification: + // a.) There is a refocus pattern given and it matches. + // or + // b.) The tab was launched as an app of the searched type AND + // either there is no refocus pattern or the url matches it. + // This is needed since a V1 applications can change the URL over + // time, and might therefore loose it's "app" status. + if (refocus_pattern.MatchesURL(tab_url) && + (!refocus_pattern.match_all_urls() || + launcher_controller()->GetPerAppInterface()-> + IsWebContentHandledByApplication(web_contents, app_id()))) items.push_back(web_contents); } } diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc index f6530ce..01f7792 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc @@ -343,10 +343,7 @@ TEST_F(ChromeLauncherControllerPerAppTest, BrowserMenuGeneration) { chrome::CloseTab(browser2.get()); } -// Check that V1 apps are correctly reflected in the launcher menu using the -// refocus logic. -// Note that the extension matching logic is tested by the extension system -// and does not need a separate test here. +// Check that V1 apps are correctly reflected in the launcher menu. TEST_F(ChromeLauncherControllerPerAppTest, V1AppMenuGeneration) { EXPECT_EQ(1U, BrowserList::size()); EXPECT_EQ(0, browser()->tab_strip_model()->count()); |