OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 // Initialize background url (optional). | 823 // Initialize background url (optional). |
824 if (source.HasKey(keys::kBackground)) { | 824 if (source.HasKey(keys::kBackground)) { |
825 std::string background_str; | 825 std::string background_str; |
826 if (!source.GetString(keys::kBackground, &background_str)) { | 826 if (!source.GetString(keys::kBackground, &background_str)) { |
827 *error = errors::kInvalidBackground; | 827 *error = errors::kInvalidBackground; |
828 return false; | 828 return false; |
829 } | 829 } |
830 background_url_ = GetResourceURL(background_str); | 830 background_url_ = GetResourceURL(background_str); |
831 } | 831 } |
832 | 832 |
| 833 // Initialize options page url (optional). |
| 834 if (source.HasKey(keys::kOptionsPage)) { |
| 835 std::string options_str; |
| 836 if (!source.GetString(keys::kOptionsPage, &options_str)) { |
| 837 *error = errors::kInvalidOptionsPage; |
| 838 return false; |
| 839 } |
| 840 options_url_ = GetResourceURL(options_str); |
| 841 } |
| 842 |
833 // Initialize toolstrips (optional). | 843 // Initialize toolstrips (optional). |
834 if (source.HasKey(keys::kToolstrips)) { | 844 if (source.HasKey(keys::kToolstrips)) { |
835 ListValue* list_value; | 845 ListValue* list_value; |
836 if (!source.GetList(keys::kToolstrips, &list_value)) { | 846 if (!source.GetList(keys::kToolstrips, &list_value)) { |
837 *error = errors::kInvalidToolstrips; | 847 *error = errors::kInvalidToolstrips; |
838 return false; | 848 return false; |
839 } | 849 } |
840 | 850 |
841 for (size_t i = 0; i < list_value->GetSize(); ++i) { | 851 for (size_t i = 0; i < list_value->GetSize(); ++i) { |
842 ToolstripInfo toolstrip; | 852 ToolstripInfo toolstrip; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 UserScript::PatternList::const_iterator pattern = | 1163 UserScript::PatternList::const_iterator pattern = |
1154 content_script->url_patterns().begin(); | 1164 content_script->url_patterns().begin(); |
1155 for (; pattern != content_script->url_patterns().end(); ++pattern) { | 1165 for (; pattern != content_script->url_patterns().end(); ++pattern) { |
1156 if (pattern->match_subdomains() && pattern->host().empty()) | 1166 if (pattern->match_subdomains() && pattern->host().empty()) |
1157 return true; | 1167 return true; |
1158 } | 1168 } |
1159 } | 1169 } |
1160 | 1170 |
1161 return false; | 1171 return false; |
1162 } | 1172 } |
OLD | NEW |