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

Side by Side Diff: chrome/common/extensions/extension.h

Issue 7917006: Extension loading extracts intents from Manifest data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 9 years, 3 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
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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/memory/linked_ptr.h" 16 #include "base/memory/linked_ptr.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
19 #include "base/synchronization/lock.h" 19 #include "base/synchronization/lock.h"
20 #include "chrome/browser/intents/web_intent_data.h"
20 #include "chrome/common/extensions/extension_constants.h" 21 #include "chrome/common/extensions/extension_constants.h"
21 #include "chrome/common/extensions/extension_icon_set.h" 22 #include "chrome/common/extensions/extension_icon_set.h"
22 #include "chrome/common/extensions/extension_permission_set.h" 23 #include "chrome/common/extensions/extension_permission_set.h"
23 #include "chrome/common/extensions/user_script.h" 24 #include "chrome/common/extensions/user_script.h"
24 #include "chrome/common/extensions/url_pattern.h" 25 #include "chrome/common/extensions/url_pattern.h"
25 #include "chrome/common/extensions/url_pattern_set.h" 26 #include "chrome/common/extensions/url_pattern_set.h"
26 #include "googleurl/src/gurl.h" 27 #include "googleurl/src/gurl.h"
27 #include "ui/gfx/size.h" 28 #include "ui/gfx/size.h"
28 29
29 class ExtensionAction; 30 class ExtensionAction;
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 return manifest_value_.get(); 527 return manifest_value_.get();
527 } 528 }
528 const std::string default_locale() const { return default_locale_; } 529 const std::string default_locale() const { return default_locale_; }
529 const URLOverrideMap& GetChromeURLOverrides() const { 530 const URLOverrideMap& GetChromeURLOverrides() const {
530 return chrome_url_overrides_; 531 return chrome_url_overrides_;
531 } 532 }
532 const std::string omnibox_keyword() const { return omnibox_keyword_; } 533 const std::string omnibox_keyword() const { return omnibox_keyword_; }
533 bool incognito_split_mode() const { return incognito_split_mode_; } 534 bool incognito_split_mode() const { return incognito_split_mode_; }
534 bool offline_enabled() const { return offline_enabled_; } 535 bool offline_enabled() const { return offline_enabled_; }
535 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; } 536 const std::vector<TtsVoice>& tts_voices() const { return tts_voices_; }
537 const std::vector<WebIntentData>& intents() const { return intents_; }
536 538
537 bool wants_file_access() const { return wants_file_access_; } 539 bool wants_file_access() const { return wants_file_access_; }
538 int creation_flags() const { return creation_flags_; } 540 int creation_flags() const { return creation_flags_; }
539 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; } 541 bool from_webstore() const { return (creation_flags_ & FROM_WEBSTORE) != 0; }
540 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; } 542 bool from_bookmark() const { return (creation_flags_ & FROM_BOOKMARK) != 0; }
541 543
542 const std::string& content_security_policy() const { 544 const std::string& content_security_policy() const {
543 return content_security_policy_; 545 return content_security_policy_;
544 } 546 }
545 547
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 const char* list_error, 636 const char* list_error,
635 const char* value_error, 637 const char* value_error,
636 URLPattern::ParseOption parse_strictness, 638 URLPattern::ParseOption parse_strictness,
637 std::string* error); 639 std::string* error);
638 bool LoadLaunchContainer(const base::DictionaryValue* manifest, 640 bool LoadLaunchContainer(const base::DictionaryValue* manifest,
639 std::string* error); 641 std::string* error);
640 bool LoadLaunchURL(const base::DictionaryValue* manifest, 642 bool LoadLaunchURL(const base::DictionaryValue* manifest,
641 std::string* error); 643 std::string* error);
642 bool LoadAppIsolation(const base::DictionaryValue* manifest, 644 bool LoadAppIsolation(const base::DictionaryValue* manifest,
643 std::string* error); 645 std::string* error);
646 bool LoadWebIntents(const base::DictionaryValue& manifest,
647 std::string* error);
644 bool EnsureNotHybridApp(const base::DictionaryValue* manifest, 648 bool EnsureNotHybridApp(const base::DictionaryValue* manifest,
645 std::string* error); 649 std::string* error);
646 650
647 // Helper method to load an ExtensionAction from the page_action or 651 // Helper method to load an ExtensionAction from the page_action or
648 // browser_action entries in the manifest. 652 // browser_action entries in the manifest.
649 ExtensionAction* LoadExtensionActionHelper( 653 ExtensionAction* LoadExtensionActionHelper(
650 const base::DictionaryValue* extension_action, std::string* error); 654 const base::DictionaryValue* extension_action, std::string* error);
651 655
652 // Helper method to load an FileBrowserHandlerList from the manifest. 656 // Helper method to load an FileBrowserHandlerList from the manifest.
653 FileBrowserHandlerList* LoadFileBrowserHandlers( 657 FileBrowserHandlerList* LoadFileBrowserHandlers(
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 // containers like panels and windows. 840 // containers like panels and windows.
837 int launch_width_; 841 int launch_width_;
838 int launch_height_; 842 int launch_height_;
839 843
840 // The Omnibox keyword for this extension, or empty if there is none. 844 // The Omnibox keyword for this extension, or empty if there is none.
841 std::string omnibox_keyword_; 845 std::string omnibox_keyword_;
842 846
843 // List of text-to-speech voices that this extension provides, if any. 847 // List of text-to-speech voices that this extension provides, if any.
844 std::vector<TtsVoice> tts_voices_; 848 std::vector<TtsVoice> tts_voices_;
845 849
850 // List of intents that this extension provides, if any.
851 std::vector<WebIntentData> intents_;
852
846 // Whether the extension has host permissions or user script patterns that 853 // Whether the extension has host permissions or user script patterns that
847 // imply access to file:/// scheme URLs (the user may not have actually 854 // imply access to file:/// scheme URLs (the user may not have actually
848 // granted it that access). 855 // granted it that access).
849 bool wants_file_access_; 856 bool wants_file_access_;
850 857
851 // The flags that were passed to InitFromValue. 858 // The flags that were passed to InitFromValue.
852 int creation_flags_; 859 int creation_flags_;
853 860
854 // The Content-Security-Policy for this extension. Extensions can use 861 // The Content-Security-Policy for this extension. Extensions can use
855 // Content-Security-Policies to mitigate cross-site scripting and other 862 // Content-Security-Policies to mitigate cross-site scripting and other
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 // only contain the removed permissions. 938 // only contain the removed permissions.
932 const ExtensionPermissionSet* permissions; 939 const ExtensionPermissionSet* permissions;
933 940
934 UpdatedExtensionPermissionsInfo( 941 UpdatedExtensionPermissionsInfo(
935 const Extension* extension, 942 const Extension* extension,
936 const ExtensionPermissionSet* permissions, 943 const ExtensionPermissionSet* permissions,
937 Reason reason); 944 Reason reason);
938 }; 945 };
939 946
940 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 947 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension.cc » ('j') | chrome/common/extensions/extension.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698