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

Side by Side Diff: chrome/browser/extensions/extensions_service.cc

Issue 2876009: Re-implement app overlap detection with new extent syntax. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: donk Created 10 years, 6 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension_extent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/extensions/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 Extension* ExtensionsService::GetExtensionByWebExtent(const GURL& url) { 961 Extension* ExtensionsService::GetExtensionByWebExtent(const GURL& url) {
962 for (size_t i = 0; i < extensions_.size(); ++i) { 962 for (size_t i = 0; i < extensions_.size(); ++i) {
963 if (extensions_[i]->web_extent().ContainsURL(url)) 963 if (extensions_[i]->web_extent().ContainsURL(url))
964 return extensions_[i]; 964 return extensions_[i];
965 } 965 }
966 return NULL; 966 return NULL;
967 } 967 }
968 968
969 Extension* ExtensionsService::GetExtensionByOverlappingWebExtent( 969 Extension* ExtensionsService::GetExtensionByOverlappingWebExtent(
970 const ExtensionExtent& extent) { 970 const ExtensionExtent& extent) {
971 // TODO(aa): Make this work for the new extents. http://crbug.com/47445. 971 for (size_t i = 0; i < extensions_.size(); ++i) {
972 if (extensions_[i]->web_extent().OverlapsWith(extent))
973 return extensions_[i];
974 }
975
972 return NULL; 976 return NULL;
973 } 977 }
974 978
975 void ExtensionsService::ClearProvidersForTesting() { 979 void ExtensionsService::ClearProvidersForTesting() {
976 ChromeThread::PostTask( 980 ChromeThread::PostTask(
977 ChromeThread::FILE, FROM_HERE, 981 ChromeThread::FILE, FROM_HERE,
978 NewRunnableMethod( 982 NewRunnableMethod(
979 backend_.get(), &ExtensionsServiceBackend::ClearProvidersForTesting)); 983 backend_.get(), &ExtensionsServiceBackend::ClearProvidersForTesting));
980 } 984 }
981 985
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 // Finish installing on UI thread. 1254 // Finish installing on UI thread.
1251 ChromeThread::PostTask( 1255 ChromeThread::PostTask(
1252 ChromeThread::UI, FROM_HERE, 1256 ChromeThread::UI, FROM_HERE,
1253 NewRunnableMethod( 1257 NewRunnableMethod(
1254 frontend_, 1258 frontend_,
1255 &ExtensionsService::ContinueLoadAllExtensions, 1259 &ExtensionsService::ContinueLoadAllExtensions,
1256 extensions_to_reload, 1260 extensions_to_reload,
1257 start_time, 1261 start_time,
1258 true)); 1262 true));
1259 } 1263 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_extent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698