diff --git a/Atom-Linux/Makefile b/Atom-Linux/Makefile index b3e85e4e0..742a5dc81 100644 --- a/Atom-Linux/Makefile +++ b/Atom-Linux/Makefile @@ -55,7 +55,7 @@ LIBS := -lX11 \ -lcef \ -lcef_dll_wrapper -SOURCES=atom.cpp cefclient.cpp native_handler.cpp client_handler.cpp client_handler_gtk.cpp +SOURCES=atom.cpp native_handler.cpp client_handler.cpp client_handler_gtk.cpp OBJECTS=$(SOURCES:.cpp=.o) INSTALLDIR=/usr/local/atom diff --git a/Atom-Linux/atom.cpp b/Atom-Linux/atom.cpp index 4fbd532c6..53e1f182e 100644 --- a/Atom-Linux/atom.cpp +++ b/Atom-Linux/atom.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "cefclient.h" +#include "atom.h" #include "include/cef_app.h" #include "include/cef_browser.h" #include "include/cef_frame.h" @@ -20,8 +20,20 @@ const char* szPath; // The folder the application is in const char* szPathToOpen; // The file to open -// The global ClientHandler reference. -extern CefRefPtr g_handler; +CefRefPtr g_handler; + +void AppGetSettings(CefSettings& settings, CefRefPtr& app) { + CefString(&settings.cache_path) = ""; + CefString(&settings.user_agent) = ""; + CefString(&settings.product_version) = ""; + CefString(&settings.locale) = ""; + CefString(&settings.log_file) = ""; + CefString(&settings.javascript_flags) = ""; + + settings.log_severity = LOGSEVERITY_ERROR; + settings.local_storage_quota = 0; + settings.session_storage_quota = 0; +} void destroy(void) { CefQuitMessageLoop(); diff --git a/Atom-Linux/cefclient.h b/Atom-Linux/atom.h similarity index 100% rename from Atom-Linux/cefclient.h rename to Atom-Linux/atom.h diff --git a/Atom-Linux/cefclient.cpp b/Atom-Linux/cefclient.cpp deleted file mode 100644 index 5ccf4d77d..000000000 --- a/Atom-Linux/cefclient.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights -// reserved. Use of this source code is governed by a BSD-style license that -// can be found in the LICENSE file. - -#include "cefclient.h" -#include -#include -#include -#include -#include "include/cef_app.h" -#include "include/cef_browser.h" -#include "include/cef_command_line.h" -#include "include/cef_frame.h" -#include "include/cef_runnable.h" -#include "include/cef_web_plugin.h" -#include "include/cef_web_urlrequest.h" -#include "client_handler.h" -#include "util.h" - -namespace { - -// Return the int representation of the specified string. -int GetIntValue(const CefString& str) { - if (str.empty()) - return 0; - - std::string stdStr = str; - return atoi(stdStr.c_str()); -} - -// ClientApp implementation. -class ClientApp: public CefApp, public CefProxyHandler { -public: - ClientApp(cef_proxy_type_t proxy_type, const CefString& proxy_config) : - proxy_type_(proxy_type), proxy_config_(proxy_config) { - } - - // CefApp methods - virtual CefRefPtr GetProxyHandler() OVERRIDE { - return this; - } - - // CefProxyHandler methods - virtual void GetProxyForUrl(const CefString& url, CefProxyInfo& proxy_info) - OVERRIDE { - proxy_info.proxyType = proxy_type_; - if (!proxy_config_.empty()) - CefString(&proxy_info.proxyList) = proxy_config_; - } - -protected: - cef_proxy_type_t proxy_type_; - CefString proxy_config_; - -IMPLEMENT_REFCOUNTING(ClientApp) - ; -}; - -} // namespace - -CefRefPtr g_handler; -CefRefPtr g_command_line; - -CefRefPtr AppGetBrowser() { - if (!g_handler.get()) - return NULL; - return g_handler->GetBrowser(); -} - -CefWindowHandle AppGetMainHwnd() { - if (!g_handler.get()) - return NULL; - return g_handler->GetMainHwnd(); -} - -void AppGetSettings(CefSettings& settings, CefRefPtr& app) { - CefString(&settings.cache_path) = ""; - CefString(&settings.user_agent) = ""; - CefString(&settings.product_version) = ""; - CefString(&settings.locale) = ""; - CefString(&settings.log_file) = ""; - CefString(&settings.javascript_flags) = ""; - - settings.log_severity = LOGSEVERITY_ERROR; - settings.local_storage_quota = 0; - settings.session_storage_quota = 0; -} diff --git a/Atom-Linux/client_handler.cpp b/Atom-Linux/client_handler.cpp index f0b8575b9..05a4987c8 100644 --- a/Atom-Linux/client_handler.cpp +++ b/Atom-Linux/client_handler.cpp @@ -9,7 +9,7 @@ #include #include "include/cef_browser.h" #include "include/cef_frame.h" -#include "cefclient.h" +#include "atom.h" #include "native_handler.h" #include