Ejemplo n.º 1
0
void CefSetting_SetCachePath(CefSettings& settings)
{
	WCHAR buffer[1024];
	if (FAILED(GetTempPath(1024, buffer)))
	{
		return;
	}
	PathAppend(buffer, L"NgineSlack\\");
	CreateDirectory(buffer, NULL);	
	
	cef_string_utf16_set(buffer, wcslen(buffer), &settings.cache_path, TRUE);
}
Ejemplo n.º 2
0
void NgineSlackBrowser::OnCreate(HWND hWnd)
{
	RECT rc;
	GetClientRect(hWnd, &rc);

	CefWindowInfo window_info;
	window_info.SetAsChild(hWnd, rc);

	const char16 *font_family = L"맑은 고딕";
	const size_t font_family_size = wcslen(font_family);

	CefBrowserSettings browser_settings;
	cef_string_utf16_set(font_family, font_family_size, &browser_settings.standard_font_family, TRUE);
	cef_string_utf16_set(font_family, font_family_size, &browser_settings.serif_font_family, TRUE);
	cef_string_utf16_set(font_family, font_family_size, &browser_settings.sans_serif_font_family, TRUE);
	cef_string_utf16_set(font_family, font_family_size, &browser_settings.cursive_font_family, TRUE);
	cef_string_utf16_set(font_family, font_family_size, &browser_settings.fantasy_font_family, TRUE);
	browser_settings.local_storage = STATE_ENABLED;
	browser_settings.databases = STATE_ENABLED;
	browser_settings.application_cache = STATE_ENABLED;
	CefString url = "https://slack.com/ssb";

	m_handler = new NgineSlackClient(this);
	CefBrowserHost::CreateBrowser(window_info, m_handler.get(), url, browser_settings, NULL);

	HINSTANCE hInst = _AtlBaseModule.GetModuleInstance();

	ZeroMemory(&m_nidTray, sizeof(m_nidTray));
	m_nidTray.cbSize = sizeof(m_nidTray);
	m_nidTray.hWnd = hWnd;
	m_nidTray.uID = (UINT)hWnd;
	m_nidTray.uFlags = NIF_MESSAGE | NIF_ICON;
	m_nidTray.uCallbackMessage = WM_NOTIFYICON_TRAY;
	m_nidTray.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
	Shell_NotifyIcon(NIM_ADD, &m_nidTray);

	HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TRAY_CONTEXTMENU));
	m_hTrayMenu = GetSubMenu(hMenu, 0);
	UpdateStartup();
}
Ejemplo n.º 3
0
// cef_settings_t->browser_subprocess_path
static void cfx_settings_set_browser_subprocess_path(cef_settings_t *self, char16 *browser_subprocess_path_str, int browser_subprocess_path_length) {
    cef_string_utf16_set(browser_subprocess_path_str, browser_subprocess_path_length, &(self->browser_subprocess_path), 1);
}
Ejemplo n.º 4
0
// cef_settings_t->accept_language_list
static void cfx_settings_set_accept_language_list(cef_settings_t *self, char16 *accept_language_list_str, int accept_language_list_length) {
    cef_string_utf16_set(accept_language_list_str, accept_language_list_length, &(self->accept_language_list), 1);
}
Ejemplo n.º 5
0
// cef_settings_t->locales_dir_path
static void cfx_settings_set_locales_dir_path(cef_settings_t *self, char16 *locales_dir_path_str, int locales_dir_path_length) {
    cef_string_utf16_set(locales_dir_path_str, locales_dir_path_length, &(self->locales_dir_path), 1);
}
Ejemplo n.º 6
0
// cef_settings_t->resources_dir_path
static void cfx_settings_set_resources_dir_path(cef_settings_t *self, char16 *resources_dir_path_str, int resources_dir_path_length) {
    cef_string_utf16_set(resources_dir_path_str, resources_dir_path_length, &(self->resources_dir_path), 1);
}
Ejemplo n.º 7
0
// cef_settings_t->javascript_flags
static void cfx_settings_set_javascript_flags(cef_settings_t *self, char16 *javascript_flags_str, int javascript_flags_length) {
    cef_string_utf16_set(javascript_flags_str, javascript_flags_length, &(self->javascript_flags), 1);
}
Ejemplo n.º 8
0
// cef_settings_t->log_file
static void cfx_settings_set_log_file(cef_settings_t *self, char16 *log_file_str, int log_file_length) {
    cef_string_utf16_set(log_file_str, log_file_length, &(self->log_file), 1);
}
Ejemplo n.º 9
0
// cef_settings_t->user_agent
static void cfx_settings_set_user_agent(cef_settings_t *self, char16 *user_agent_str, int user_agent_length) {
    cef_string_utf16_set(user_agent_str, user_agent_length, &(self->user_agent), 1);
}
Ejemplo n.º 10
0
// cef_settings_t->user_data_path
static void cfx_settings_set_user_data_path(cef_settings_t *self, char16 *user_data_path_str, int user_data_path_length) {
    cef_string_utf16_set(user_data_path_str, user_data_path_length, &(self->user_data_path), 1);
}
Ejemplo n.º 11
0
// cef_cookie_t->path
static void cfx_cookie_set_path(cef_cookie_t *self, char16 *path_str, int path_length) {
    cef_string_utf16_set(path_str, path_length, &(self->path), 1);
}
Ejemplo n.º 12
0
// cef_cookie_t->domain
static void cfx_cookie_set_domain(cef_cookie_t *self, char16 *domain_str, int domain_length) {
    cef_string_utf16_set(domain_str, domain_length, &(self->domain), 1);
}
Ejemplo n.º 13
0
// cef_cookie_t->value
static void cfx_cookie_set_value(cef_cookie_t *self, char16 *value_str, int value_length) {
    cef_string_utf16_set(value_str, value_length, &(self->value), 1);
}
Ejemplo n.º 14
0
// cef_cookie_t->name
static void cfx_cookie_set_name(cef_cookie_t *self, char16 *name_str, int name_length) {
    cef_string_utf16_set(name_str, name_length, &(self->name), 1);
}
Ejemplo n.º 15
0
// cef_settings_t->framework_dir_path
static void cfx_settings_set_framework_dir_path(cef_settings_t *self, char16 *framework_dir_path_str, int framework_dir_path_length) {
    cef_string_utf16_set(framework_dir_path_str, framework_dir_path_length, &(self->framework_dir_path), 1);
}
Ejemplo n.º 16
0
// cef_settings_t->cache_path
static void cfx_settings_set_cache_path(cef_settings_t *self, char16 *cache_path_str, int cache_path_length) {
    cef_string_utf16_set(cache_path_str, cache_path_length, &(self->cache_path), 1);
}
Ejemplo n.º 17
0
// cef_settings_t->product_version
static void cfx_settings_set_product_version(cef_settings_t *self, char16 *product_version_str, int product_version_length) {
    cef_string_utf16_set(product_version_str, product_version_length, &(self->product_version), 1);
}