uriloader/exthandler/android/nsMIMEInfoAndroid.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial