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

Side by Side Diff: chrome/common/extensions/extension_set.cc

Issue 8542001: Insert default stylesheet for platform apps. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/extensions/extension_set.h" 5 #include "chrome/common/extensions/extension_set.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/common/url_constants.h" 8 #include "chrome/common/url_constants.h"
9 9
10 ExtensionSet::ExtensionSet() { 10 ExtensionSet::ExtensionSet() {
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 void ExtensionSet::Insert(const scoped_refptr<const Extension>& extension) { 24 void ExtensionSet::Insert(const scoped_refptr<const Extension>& extension) {
25 extensions_[extension->id()] = extension; 25 extensions_[extension->id()] = extension;
26 } 26 }
27 27
28 void ExtensionSet::Remove(const std::string& id) { 28 void ExtensionSet::Remove(const std::string& id) {
29 extensions_.erase(id); 29 extensions_.erase(id);
30 } 30 }
31 31
32 void ExtensionSet::Clear() {
33 extensions_.clear();
34 }
35
32 std::string ExtensionSet::GetIdByURL(const GURL& url) const { 36 std::string ExtensionSet::GetIdByURL(const GURL& url) const {
33 if (url.SchemeIs(chrome::kExtensionScheme)) 37 if (url.SchemeIs(chrome::kExtensionScheme))
34 return url.host(); 38 return url.host();
35 39
36 const Extension* extension = GetByURL(url); 40 const Extension* extension = GetByURL(url);
37 if (!extension) 41 if (!extension)
38 return ""; 42 return "";
39 43
40 return extension->id(); 44 return extension->id();
41 } 45 }
(...skipping 30 matching lines...) Expand all
72 76
73 ExtensionMap::const_iterator i = extensions_.begin(); 77 ExtensionMap::const_iterator i = extensions_.begin();
74 for (; i != extensions_.end(); ++i) { 78 for (; i != extensions_.end(); ++i) {
75 if (i->second->location() == Extension::COMPONENT && 79 if (i->second->location() == Extension::COMPONENT &&
76 i->second->web_extent().MatchesURL(url)) 80 i->second->web_extent().MatchesURL(url))
77 return true; 81 return true;
78 } 82 }
79 83
80 return false; 84 return false;
81 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698