OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef EXTENSIONS_COMMON_EXTENSION_H_ | 5 #ifndef EXTENSIONS_COMMON_EXTENSION_H_ |
6 #define EXTENSIONS_COMMON_EXTENSION_H_ | 6 #define EXTENSIONS_COMMON_EXTENSION_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 private: | 335 private: |
336 friend class base::RefCountedThreadSafe<Extension>; | 336 friend class base::RefCountedThreadSafe<Extension>; |
337 | 337 |
338 // Chooses the extension ID for an extension based on a variety of criteria. | 338 // Chooses the extension ID for an extension based on a variety of criteria. |
339 // The chosen ID will be set in |manifest|. | 339 // The chosen ID will be set in |manifest|. |
340 static bool InitExtensionID(extensions::Manifest* manifest, | 340 static bool InitExtensionID(extensions::Manifest* manifest, |
341 const base::FilePath& path, | 341 const base::FilePath& path, |
342 const std::string& explicit_id, | 342 const std::string& explicit_id, |
343 int creation_flags, | 343 int creation_flags, |
344 string16* error); | 344 base::string16* error); |
345 | 345 |
346 Extension(const base::FilePath& path, | 346 Extension(const base::FilePath& path, |
347 scoped_ptr<extensions::Manifest> manifest); | 347 scoped_ptr<extensions::Manifest> manifest); |
348 virtual ~Extension(); | 348 virtual ~Extension(); |
349 | 349 |
350 // Initialize the extension from a parsed manifest. | 350 // Initialize the extension from a parsed manifest. |
351 // TODO(aa): Rename to just Init()? There's no Value here anymore. | 351 // TODO(aa): Rename to just Init()? There's no Value here anymore. |
352 // TODO(aa): It is really weird the way this class essentially contains a copy | 352 // TODO(aa): It is really weird the way this class essentially contains a copy |
353 // of the underlying DictionaryValue in its members. We should decide to | 353 // of the underlying DictionaryValue in its members. We should decide to |
354 // either wrap the DictionaryValue and go with that only, or we should parse | 354 // either wrap the DictionaryValue and go with that only, or we should parse |
355 // into strong types and discard the value. But doing both is bad. | 355 // into strong types and discard the value. But doing both is bad. |
356 bool InitFromValue(int flags, string16* error); | 356 bool InitFromValue(int flags, base::string16* error); |
357 | 357 |
358 // The following are helpers for InitFromValue to load various features of the | 358 // The following are helpers for InitFromValue to load various features of the |
359 // extension from the manifest. | 359 // extension from the manifest. |
360 | 360 |
361 bool LoadRequiredFeatures(string16* error); | 361 bool LoadRequiredFeatures(base::string16* error); |
362 bool LoadName(string16* error); | 362 bool LoadName(base::string16* error); |
363 bool LoadVersion(string16* error); | 363 bool LoadVersion(base::string16* error); |
364 | 364 |
365 bool LoadAppFeatures(string16* error); | 365 bool LoadAppFeatures(base::string16* error); |
366 bool LoadExtent(const char* key, | 366 bool LoadExtent(const char* key, |
367 URLPatternSet* extent, | 367 URLPatternSet* extent, |
368 const char* list_error, | 368 const char* list_error, |
369 const char* value_error, | 369 const char* value_error, |
370 string16* error); | 370 base::string16* error); |
371 | 371 |
372 bool LoadSharedFeatures(string16* error); | 372 bool LoadSharedFeatures(base::string16* error); |
373 bool LoadDescription(string16* error); | 373 bool LoadDescription(base::string16* error); |
374 bool LoadManifestVersion(string16* error); | 374 bool LoadManifestVersion(base::string16* error); |
375 bool LoadShortName(string16* error); | 375 bool LoadShortName(base::string16* error); |
376 | 376 |
377 bool CheckMinimumChromeVersion(string16* error) const; | 377 bool CheckMinimumChromeVersion(base::string16* error) const; |
378 | 378 |
379 // The extension's human-readable name. Name is used for display purpose. It | 379 // The extension's human-readable name. Name is used for display purpose. It |
380 // might be wrapped with unicode bidi control characters so that it is | 380 // might be wrapped with unicode bidi control characters so that it is |
381 // displayed correctly in RTL context. | 381 // displayed correctly in RTL context. |
382 // NOTE: Name is UTF-8 and may contain non-ascii characters. | 382 // NOTE: Name is UTF-8 and may contain non-ascii characters. |
383 std::string name_; | 383 std::string name_; |
384 | 384 |
385 // A non-localized version of the extension's name. This is useful for | 385 // A non-localized version of the extension's name. This is useful for |
386 // debug output. | 386 // debug output. |
387 std::string non_localized_name_; | 387 std::string non_localized_name_; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 531 |
532 UpdatedExtensionPermissionsInfo( | 532 UpdatedExtensionPermissionsInfo( |
533 const Extension* extension, | 533 const Extension* extension, |
534 const PermissionSet* permissions, | 534 const PermissionSet* permissions, |
535 Reason reason); | 535 Reason reason); |
536 }; | 536 }; |
537 | 537 |
538 } // namespace extensions | 538 } // namespace extensions |
539 | 539 |
540 #endif // EXTENSIONS_COMMON_EXTENSION_H_ | 540 #endif // EXTENSIONS_COMMON_EXTENSION_H_ |
OLD | NEW |