1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/uriloader/exthandler/android/nsMIMEInfoAndroid.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsMIMEInfoAndroid_h 1.10 +#define nsMIMEInfoAndroid_h 1.11 + 1.12 +#include "nsMIMEInfoImpl.h" 1.13 +#include "nsIMutableArray.h" 1.14 +#include "nsAndroidHandlerApp.h" 1.15 + 1.16 +class nsMIMEInfoAndroid MOZ_FINAL : public nsIMIMEInfo 1.17 +{ 1.18 +public: 1.19 + static bool 1.20 + GetMimeInfoForMimeType(const nsACString& aMimeType, 1.21 + nsMIMEInfoAndroid** aMimeInfo); 1.22 + static bool 1.23 + GetMimeInfoForFileExt(const nsACString& aFileExt, 1.24 + nsMIMEInfoAndroid** aMimeInfo); 1.25 + 1.26 + static nsresult 1.27 + GetMimeInfoForURL(const nsACString &aURL, bool *found, 1.28 + nsIHandlerInfo **info); 1.29 + 1.30 + NS_DECL_ISUPPORTS 1.31 + NS_DECL_NSIMIMEINFO 1.32 + NS_DECL_NSIHANDLERINFO 1.33 + 1.34 + nsMIMEInfoAndroid(const nsACString& aMIMEType); 1.35 + 1.36 +protected: 1.37 + virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile* aFile); 1.38 + virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI); 1.39 + nsCOMPtr<nsIMutableArray> mHandlerApps; 1.40 + nsCString mType; 1.41 + nsTArray<nsCString> mExtensions; 1.42 + bool mAlwaysAsk; 1.43 + nsHandlerInfoAction mPrefAction; 1.44 + nsString mDescription; 1.45 + nsCOMPtr<nsIHandlerApp> mPrefApp; 1.46 + 1.47 + class SystemChooser MOZ_FINAL : public nsIHandlerApp { 1.48 + public: 1.49 + NS_DECL_ISUPPORTS 1.50 + NS_DECL_NSIHANDLERAPP 1.51 + SystemChooser(nsMIMEInfoAndroid* aOuter): mOuter(aOuter) {}; 1.52 + 1.53 + private: 1.54 + nsMIMEInfoAndroid* mOuter; 1.55 + 1.56 + }; 1.57 +}; 1.58 + 1.59 +#endif /* nsMIMEInfoAndroid_h */