-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathprofile.cpp
More file actions
67 lines (53 loc) · 1.65 KB
/
profile.cpp
File metadata and controls
67 lines (53 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "profile.h"
#include "cwv2types.h"
using namespace wv2_;
profile::profile() {
}
profile::~profile() {
}
void profile::setProfile(CComPtr<ICoreWebView2Profile> profile) {
profile_ = profile;
}
ICoreWebView2Profile* profile::getProfile() {
return profile_;
}
void profile::releaseProfile() {
profile_.Release();
}
// wv2profile interface ///////////////////////////////////////////////
LPWSTR profile::getProfileName() {
return getStrVal([this](LPWSTR* value) {
return profile_->get_ProfileName(value);
});
}
bool profile::getIsInPrivateModeEnabled() {
BOOL isInPrivateModeEnabled = FALSE;
if (SUCCEEDED(profile_->get_IsInPrivateModeEnabled(&isInPrivateModeEnabled))) {
return isInPrivateModeEnabled ? true : false;
}
return false;
}
LPWSTR profile::getProfilePath() {
return getStrVal([this](LPWSTR* value) {
return profile_->get_ProfilePath(value);
});
}
LPWSTR profile::getDefaultDownloadFolderPath() {
return getStrVal([this](LPWSTR* value) {
return profile_->get_DefaultDownloadFolderPath(value);
});
}
HRESULT profile::setDefaultDownloadFolderPath(LPCWSTR value) {
return profile_->put_DefaultDownloadFolderPath(value);
}
wv2preferredColorScheme profile::getPreferredColorScheme() {
COREWEBVIEW2_PREFERRED_COLOR_SCHEME scheme;
if (SUCCEEDED(profile_->get_PreferredColorScheme(&scheme))) {
return static_cast<wv2preferredColorScheme>(scheme);
}
return wv2preferredColorScheme_undefined;
}
HRESULT profile::setPreferredColorScheme(wv2preferredColorScheme value) {
return profile_->put_PreferredColorScheme(static_cast<COREWEBVIEW2_PREFERRED_COLOR_SCHEME>(value));
}
// wv2profile interface ///////////////////////////////////////////////