| |
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
| |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| |
4 |
| |
5 #include "nsAuthInformationHolder.h" |
| |
6 |
| |
7 NS_IMPL_ISUPPORTS(nsAuthInformationHolder, nsIAuthInformation) |
| |
8 |
| |
9 NS_IMETHODIMP |
| |
10 nsAuthInformationHolder::GetFlags(uint32_t* aFlags) |
| |
11 { |
| |
12 *aFlags = mFlags; |
| |
13 return NS_OK; |
| |
14 } |
| |
15 |
| |
16 NS_IMETHODIMP |
| |
17 nsAuthInformationHolder::GetRealm(nsAString& aRealm) |
| |
18 { |
| |
19 aRealm = mRealm; |
| |
20 return NS_OK; |
| |
21 } |
| |
22 |
| |
23 NS_IMETHODIMP |
| |
24 nsAuthInformationHolder::GetAuthenticationScheme(nsACString& aScheme) |
| |
25 { |
| |
26 aScheme = mAuthType; |
| |
27 return NS_OK; |
| |
28 } |
| |
29 |
| |
30 NS_IMETHODIMP |
| |
31 nsAuthInformationHolder::GetUsername(nsAString& aUserName) |
| |
32 { |
| |
33 aUserName = mUser; |
| |
34 return NS_OK; |
| |
35 } |
| |
36 |
| |
37 NS_IMETHODIMP |
| |
38 nsAuthInformationHolder::SetUsername(const nsAString& aUserName) |
| |
39 { |
| |
40 if (!(mFlags & ONLY_PASSWORD)) |
| |
41 mUser = aUserName; |
| |
42 return NS_OK; |
| |
43 } |
| |
44 |
| |
45 NS_IMETHODIMP |
| |
46 nsAuthInformationHolder::GetPassword(nsAString& aPassword) |
| |
47 { |
| |
48 aPassword = mPassword; |
| |
49 return NS_OK; |
| |
50 } |
| |
51 |
| |
52 NS_IMETHODIMP |
| |
53 nsAuthInformationHolder::SetPassword(const nsAString& aPassword) |
| |
54 { |
| |
55 mPassword = aPassword; |
| |
56 return NS_OK; |
| |
57 } |
| |
58 |
| |
59 NS_IMETHODIMP |
| |
60 nsAuthInformationHolder::GetDomain(nsAString& aDomain) |
| |
61 { |
| |
62 aDomain = mDomain; |
| |
63 return NS_OK; |
| |
64 } |
| |
65 |
| |
66 NS_IMETHODIMP |
| |
67 nsAuthInformationHolder::SetDomain(const nsAString& aDomain) |
| |
68 { |
| |
69 if (mFlags & NEED_DOMAIN) |
| |
70 mDomain = aDomain; |
| |
71 return NS_OK; |
| |
72 } |
| |
73 |
| |
74 |