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

Side by Side Diff: extensions/common/features/simple_feature.cc

Issue 411733002: WIP: diff which plumbs through the event URL. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « extensions/common/extension_messages.h ('k') | extensions/renderer/event_bindings.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/features/simple_feature.h" 5 #include "extensions/common/features/simple_feature.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 extension->location(), 395 extension->location(),
396 extension->manifest_version(), 396 extension->manifest_version(),
397 platform); 397 platform);
398 if (!result.is_available()) 398 if (!result.is_available())
399 return result; 399 return result;
400 } 400 }
401 401
402 if (!contexts_.empty() && contexts_.find(context) == contexts_.end()) 402 if (!contexts_.empty() && contexts_.find(context) == contexts_.end())
403 return CreateAvailability(INVALID_CONTEXT, context); 403 return CreateAvailability(INVALID_CONTEXT, context);
404 404
405 if (context == WEB_PAGE_CONTEXT && !matches_.MatchesURL(url)) 405 if ((context == WEB_PAGE_CONTEXT || context == WEBUI_CONTEXT) &&
406 !matches_.MatchesURL(url)) {
406 return CreateAvailability(INVALID_URL, url); 407 return CreateAvailability(INVALID_URL, url);
408 }
407 409
408 for (FilterList::const_iterator filter_iter = filters_.begin(); 410 for (FilterList::const_iterator filter_iter = filters_.begin();
409 filter_iter != filters_.end(); 411 filter_iter != filters_.end();
410 ++filter_iter) { 412 ++filter_iter) {
411 Availability availability = 413 Availability availability =
412 (*filter_iter)->IsAvailableToContext(extension, context, url, platform); 414 (*filter_iter)->IsAvailableToContext(extension, context, url, platform);
413 if (!availability.is_available()) 415 if (!availability.is_available())
414 return availability; 416 return availability;
415 } 417 }
416 418
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 if (!dependency) 569 if (!dependency)
568 return CreateAvailability(NOT_PRESENT); 570 return CreateAvailability(NOT_PRESENT);
569 Availability dependency_availability = checker.Run(dependency); 571 Availability dependency_availability = checker.Run(dependency);
570 if (!dependency_availability.is_available()) 572 if (!dependency_availability.is_available())
571 return dependency_availability; 573 return dependency_availability;
572 } 574 }
573 return CreateAvailability(IS_AVAILABLE); 575 return CreateAvailability(IS_AVAILABLE);
574 } 576 }
575 577
576 } // namespace extensions 578 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/extension_messages.h ('k') | extensions/renderer/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698