| 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/file_path.h" | 8 #include "base/file_path.h" | 
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" | 
| 10 #include "base/logging.h" | 10 #include "base/logging.h" | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 27 const wchar_t* Extension::kNameKey = L"name"; | 27 const wchar_t* Extension::kNameKey = L"name"; | 
| 28 const wchar_t* Extension::kPageActionsKey = L"page_actions"; | 28 const wchar_t* Extension::kPageActionsKey = L"page_actions"; | 
| 29 const wchar_t* Extension::kPermissionsKey = L"permissions"; | 29 const wchar_t* Extension::kPermissionsKey = L"permissions"; | 
| 30 const wchar_t* Extension::kPluginsDirKey = L"plugins_dir"; | 30 const wchar_t* Extension::kPluginsDirKey = L"plugins_dir"; | 
| 31 const wchar_t* Extension::kBackgroundKey = L"background_page"; | 31 const wchar_t* Extension::kBackgroundKey = L"background_page"; | 
| 32 const wchar_t* Extension::kRunAtKey = L"run_at"; | 32 const wchar_t* Extension::kRunAtKey = L"run_at"; | 
| 33 const wchar_t* Extension::kThemeKey = L"theme"; | 33 const wchar_t* Extension::kThemeKey = L"theme"; | 
| 34 const wchar_t* Extension::kThemeImagesKey = L"images"; | 34 const wchar_t* Extension::kThemeImagesKey = L"images"; | 
| 35 const wchar_t* Extension::kThemeColorsKey = L"colors"; | 35 const wchar_t* Extension::kThemeColorsKey = L"colors"; | 
| 36 const wchar_t* Extension::kThemeTintsKey = L"tints"; | 36 const wchar_t* Extension::kThemeTintsKey = L"tints"; | 
|  | 37 const wchar_t* Extension::kThemeDisplayPropertiesKey = L"properties"; | 
| 37 const wchar_t* Extension::kToolstripsKey = L"toolstrips"; | 38 const wchar_t* Extension::kToolstripsKey = L"toolstrips"; | 
| 38 const wchar_t* Extension::kTooltipKey = L"tooltip"; | 39 const wchar_t* Extension::kTooltipKey = L"tooltip"; | 
| 39 const wchar_t* Extension::kTypeKey = L"type"; | 40 const wchar_t* Extension::kTypeKey = L"type"; | 
| 40 const wchar_t* Extension::kVersionKey = L"version"; | 41 const wchar_t* Extension::kVersionKey = L"version"; | 
| 41 const wchar_t* Extension::kZipHashKey = L"zip_hash"; | 42 const wchar_t* Extension::kZipHashKey = L"zip_hash"; | 
| 42 | 43 | 
| 43 const char* Extension::kRunAtDocumentStartValue = "document_start"; | 44 const char* Extension::kRunAtDocumentStartValue = "document_start"; | 
| 44 const char* Extension::kRunAtDocumentEndValue = "document_end"; | 45 const char* Extension::kRunAtDocumentEndValue = "document_end"; | 
| 45 const char* Extension::kPageActionTypeTab = "tab"; | 46 const char* Extension::kPageActionTypeTab = "tab"; | 
| 46 const char* Extension::kPageActionTypePermanent = "permanent"; | 47 const char* Extension::kPageActionTypePermanent = "permanent"; | 
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 570             !tint_list->GetReal(2, &hue)) { | 571             !tint_list->GetReal(2, &hue)) { | 
| 571           *error = kInvalidThemeTintsError; | 572           *error = kInvalidThemeTintsError; | 
| 572           return false; | 573           return false; | 
| 573         } | 574         } | 
| 574         ++iter; | 575         ++iter; | 
| 575       } | 576       } | 
| 576       theme_tints_.reset( | 577       theme_tints_.reset( | 
| 577           static_cast<DictionaryValue*>(tints_value->DeepCopy())); | 578           static_cast<DictionaryValue*>(tints_value->DeepCopy())); | 
| 578     } | 579     } | 
| 579 | 580 | 
|  | 581     DictionaryValue* display_properties_value; | 
|  | 582     if (theme_value->GetDictionary(kThemeDisplayPropertiesKey, | 
|  | 583         &display_properties_value)) { | 
|  | 584       theme_display_properties_.reset( | 
|  | 585           static_cast<DictionaryValue*>(display_properties_value->DeepCopy())); | 
|  | 586     } | 
|  | 587 | 
| 580     return true; | 588     return true; | 
| 581   } | 589   } | 
| 582 | 590 | 
| 583   // Initialize plugins dir (optional). | 591   // Initialize plugins dir (optional). | 
| 584   if (source.HasKey(kPluginsDirKey)) { | 592   if (source.HasKey(kPluginsDirKey)) { | 
| 585     std::string plugins_dir; | 593     std::string plugins_dir; | 
| 586     if (!source.GetString(kPluginsDirKey, &plugins_dir)) { | 594     if (!source.GetString(kPluginsDirKey, &plugins_dir)) { | 
| 587       *error = kInvalidPluginsDirError; | 595       *error = kInvalidPluginsDirError; | 
| 588       return false; | 596       return false; | 
| 589     } | 597     } | 
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 703             kInvalidPermissionSchemeError, IntToString(i)); | 711             kInvalidPermissionSchemeError, IntToString(i)); | 
| 704         return false; | 712         return false; | 
| 705       } | 713       } | 
| 706 | 714 | 
| 707       permissions_.push_back(pattern); | 715       permissions_.push_back(pattern); | 
| 708     } | 716     } | 
| 709   } | 717   } | 
| 710 | 718 | 
| 711   return true; | 719   return true; | 
| 712 } | 720 } | 
| OLD | NEW | 
|---|