Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsMIMEInfoAndroid_h |
michael@0 | 7 | #define nsMIMEInfoAndroid_h |
michael@0 | 8 | |
michael@0 | 9 | #include "nsMIMEInfoImpl.h" |
michael@0 | 10 | #include "nsIMutableArray.h" |
michael@0 | 11 | #include "nsAndroidHandlerApp.h" |
michael@0 | 12 | |
michael@0 | 13 | class nsMIMEInfoAndroid MOZ_FINAL : public nsIMIMEInfo |
michael@0 | 14 | { |
michael@0 | 15 | public: |
michael@0 | 16 | static bool |
michael@0 | 17 | GetMimeInfoForMimeType(const nsACString& aMimeType, |
michael@0 | 18 | nsMIMEInfoAndroid** aMimeInfo); |
michael@0 | 19 | static bool |
michael@0 | 20 | GetMimeInfoForFileExt(const nsACString& aFileExt, |
michael@0 | 21 | nsMIMEInfoAndroid** aMimeInfo); |
michael@0 | 22 | |
michael@0 | 23 | static nsresult |
michael@0 | 24 | GetMimeInfoForURL(const nsACString &aURL, bool *found, |
michael@0 | 25 | nsIHandlerInfo **info); |
michael@0 | 26 | |
michael@0 | 27 | NS_DECL_ISUPPORTS |
michael@0 | 28 | NS_DECL_NSIMIMEINFO |
michael@0 | 29 | NS_DECL_NSIHANDLERINFO |
michael@0 | 30 | |
michael@0 | 31 | nsMIMEInfoAndroid(const nsACString& aMIMEType); |
michael@0 | 32 | |
michael@0 | 33 | protected: |
michael@0 | 34 | virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile* aFile); |
michael@0 | 35 | virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI); |
michael@0 | 36 | nsCOMPtr<nsIMutableArray> mHandlerApps; |
michael@0 | 37 | nsCString mType; |
michael@0 | 38 | nsTArray<nsCString> mExtensions; |
michael@0 | 39 | bool mAlwaysAsk; |
michael@0 | 40 | nsHandlerInfoAction mPrefAction; |
michael@0 | 41 | nsString mDescription; |
michael@0 | 42 | nsCOMPtr<nsIHandlerApp> mPrefApp; |
michael@0 | 43 | |
michael@0 | 44 | class SystemChooser MOZ_FINAL : public nsIHandlerApp { |
michael@0 | 45 | public: |
michael@0 | 46 | NS_DECL_ISUPPORTS |
michael@0 | 47 | NS_DECL_NSIHANDLERAPP |
michael@0 | 48 | SystemChooser(nsMIMEInfoAndroid* aOuter): mOuter(aOuter) {}; |
michael@0 | 49 | |
michael@0 | 50 | private: |
michael@0 | 51 | nsMIMEInfoAndroid* mOuter; |
michael@0 | 52 | |
michael@0 | 53 | }; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | #endif /* nsMIMEInfoAndroid_h */ |