mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: Fix member variable naming to match Chromium style.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1768 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -86,18 +86,18 @@ bool ParseTestUrl(const std::string& url,
|
||||
|
||||
} // namespace
|
||||
|
||||
int ClientHandler::m_BrowserCount = 0;
|
||||
int ClientHandler::browser_count_ = 0;
|
||||
|
||||
ClientHandler::ClientHandler()
|
||||
: m_MainHwnd(NULL),
|
||||
m_BrowserId(0),
|
||||
m_bIsClosing(false),
|
||||
m_EditHwnd(NULL),
|
||||
m_BackHwnd(NULL),
|
||||
m_ForwardHwnd(NULL),
|
||||
m_StopHwnd(NULL),
|
||||
m_ReloadHwnd(NULL),
|
||||
m_bFocusOnEditableField(false) {
|
||||
: main_handle_(NULL),
|
||||
browser_id_(0),
|
||||
is_closing_(false),
|
||||
edit_handle_(NULL),
|
||||
back_handle_(NULL),
|
||||
forward_handle_(NULL),
|
||||
stop_handle_(NULL),
|
||||
reload_handle_(NULL),
|
||||
focus_on_editable_field_(false) {
|
||||
#if defined(OS_LINUX)
|
||||
gtk_dialog_ = NULL;
|
||||
#endif
|
||||
@@ -107,11 +107,11 @@ ClientHandler::ClientHandler()
|
||||
CefCommandLine::GetGlobalCommandLine();
|
||||
|
||||
if (command_line->HasSwitch(cefclient::kUrl))
|
||||
m_StartupURL = command_line->GetSwitchValue(cefclient::kUrl);
|
||||
if (m_StartupURL.empty())
|
||||
m_StartupURL = "http://www.google.com/";
|
||||
startup_url_ = command_line->GetSwitchValue(cefclient::kUrl);
|
||||
if (startup_url_.empty())
|
||||
startup_url_ = "http://www.google.com/";
|
||||
|
||||
m_bMouseCursorChangeDisabled =
|
||||
mouse_cursor_change_disabled_ =
|
||||
command_line->HasSwitch(cefclient::kMouseCursorChangeDisabled);
|
||||
}
|
||||
|
||||
@@ -131,10 +131,10 @@ bool ClientHandler::OnProcessMessageReceived(
|
||||
std::string message_name = message->GetName();
|
||||
if (message_name == client_renderer::kFocusedNodeChangedMessage) {
|
||||
// A message is sent from ClientRenderDelegate to tell us whether the
|
||||
// currently focused DOM node is editable. Use of |m_bFocusOnEditableField|
|
||||
// currently focused DOM node is editable. Use of |focus_on_editable_field_|
|
||||
// is redundant with CefKeyEvent.focus_on_editable_field in OnPreKeyEvent
|
||||
// but is useful for demonstration purposes.
|
||||
m_bFocusOnEditableField = message->GetArgumentList()->GetBool(0);
|
||||
focus_on_editable_field_ = message->GetArgumentList()->GetBool(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
|
||||
{
|
||||
AutoLock lock_scope(this);
|
||||
|
||||
first_message = m_LogFile.empty();
|
||||
first_message = log_file_.empty();
|
||||
if (first_message) {
|
||||
std::stringstream ss;
|
||||
ss << AppGetWorkingDirectory();
|
||||
@@ -213,9 +213,9 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr<CefBrowser> browser,
|
||||
ss << "/";
|
||||
#endif
|
||||
ss << "console.log";
|
||||
m_LogFile = ss.str();
|
||||
log_file_ = ss.str();
|
||||
}
|
||||
logFile = m_LogFile;
|
||||
logFile = log_file_;
|
||||
}
|
||||
|
||||
FILE* file = fopen(logFile.c_str(), "a");
|
||||
@@ -355,17 +355,17 @@ void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
||||
}
|
||||
|
||||
// Disable mouse cursor change if requested via the command-line flag.
|
||||
if (m_bMouseCursorChangeDisabled)
|
||||
if (mouse_cursor_change_disabled_)
|
||||
browser->GetHost()->SetMouseCursorChangeDisabled(true);
|
||||
|
||||
AutoLock lock_scope(this);
|
||||
if (!m_Browser.get()) {
|
||||
if (!browser_.get()) {
|
||||
// We need to keep the main child window, but not popup windows
|
||||
m_Browser = browser;
|
||||
m_BrowserId = browser->GetIdentifier();
|
||||
browser_ = browser;
|
||||
browser_id_ = browser->GetIdentifier();
|
||||
} else if (browser->IsPopup()) {
|
||||
// Add to the list of popup browsers.
|
||||
m_PopupBrowsers.push_back(browser);
|
||||
popup_browsers_.push_back(browser);
|
||||
|
||||
// Give focus to the popup browser. Perform asynchronously because the
|
||||
// parent window may attempt to keep focus after launching the popup.
|
||||
@@ -374,7 +374,7 @@ void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
||||
&CefBrowserHost::SetFocus, true));
|
||||
}
|
||||
|
||||
m_BrowserCount++;
|
||||
browser_count_++;
|
||||
}
|
||||
|
||||
bool ClientHandler::DoClose(CefRefPtr<CefBrowser> browser) {
|
||||
@@ -383,9 +383,9 @@ bool ClientHandler::DoClose(CefRefPtr<CefBrowser> browser) {
|
||||
// Closing the main window requires special handling. See the DoClose()
|
||||
// documentation in the CEF header for a detailed destription of this
|
||||
// process.
|
||||
if (m_BrowserId == browser->GetIdentifier()) {
|
||||
if (browser_id_ == browser->GetIdentifier()) {
|
||||
// Set a flag to indicate that the window close should be allowed.
|
||||
m_bIsClosing = true;
|
||||
is_closing_ = true;
|
||||
}
|
||||
|
||||
// Allow the close. For windowed browsers this will result in the OS close
|
||||
@@ -398,26 +398,26 @@ void ClientHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
||||
|
||||
message_router_->OnBeforeClose(browser);
|
||||
|
||||
if (m_BrowserId == browser->GetIdentifier()) {
|
||||
if (browser_id_ == browser->GetIdentifier()) {
|
||||
// Free the browser pointer so that the browser can be destroyed
|
||||
m_Browser = NULL;
|
||||
browser_ = NULL;
|
||||
|
||||
if (m_OSRHandler.get()) {
|
||||
m_OSRHandler->OnBeforeClose(browser);
|
||||
m_OSRHandler = NULL;
|
||||
if (osr_handler_.get()) {
|
||||
osr_handler_->OnBeforeClose(browser);
|
||||
osr_handler_ = NULL;
|
||||
}
|
||||
} else if (browser->IsPopup()) {
|
||||
// Remove from the browser popup list.
|
||||
BrowserList::iterator bit = m_PopupBrowsers.begin();
|
||||
for (; bit != m_PopupBrowsers.end(); ++bit) {
|
||||
BrowserList::iterator bit = popup_browsers_.begin();
|
||||
for (; bit != popup_browsers_.end(); ++bit) {
|
||||
if ((*bit)->IsSame(browser)) {
|
||||
m_PopupBrowsers.erase(bit);
|
||||
popup_browsers_.erase(bit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (--m_BrowserCount == 0) {
|
||||
if (--browser_count_ == 0) {
|
||||
// All browser windows have closed.
|
||||
// Remove and delete message router handlers.
|
||||
MessageHandlerSet::const_iterator it = message_handler_set_.begin();
|
||||
@@ -558,15 +558,15 @@ void ClientHandler::OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
|
||||
|
||||
bool ClientHandler::GetRootScreenRect(CefRefPtr<CefBrowser> browser,
|
||||
CefRect& rect) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return false;
|
||||
return m_OSRHandler->GetRootScreenRect(browser, rect);
|
||||
return osr_handler_->GetRootScreenRect(browser, rect);
|
||||
}
|
||||
|
||||
bool ClientHandler::GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return false;
|
||||
return m_OSRHandler->GetViewRect(browser, rect);
|
||||
return osr_handler_->GetViewRect(browser, rect);
|
||||
}
|
||||
|
||||
bool ClientHandler::GetScreenPoint(CefRefPtr<CefBrowser> browser,
|
||||
@@ -574,30 +574,30 @@ bool ClientHandler::GetScreenPoint(CefRefPtr<CefBrowser> browser,
|
||||
int viewY,
|
||||
int& screenX,
|
||||
int& screenY) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return false;
|
||||
return m_OSRHandler->GetScreenPoint(browser, viewX, viewY, screenX, screenY);
|
||||
return osr_handler_->GetScreenPoint(browser, viewX, viewY, screenX, screenY);
|
||||
}
|
||||
|
||||
bool ClientHandler::GetScreenInfo(CefRefPtr<CefBrowser> browser,
|
||||
CefScreenInfo& screen_info) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return false;
|
||||
return m_OSRHandler->GetScreenInfo(browser, screen_info);
|
||||
return osr_handler_->GetScreenInfo(browser, screen_info);
|
||||
}
|
||||
|
||||
void ClientHandler::OnPopupShow(CefRefPtr<CefBrowser> browser,
|
||||
bool show) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return;
|
||||
return m_OSRHandler->OnPopupShow(browser, show);
|
||||
return osr_handler_->OnPopupShow(browser, show);
|
||||
}
|
||||
|
||||
void ClientHandler::OnPopupSize(CefRefPtr<CefBrowser> browser,
|
||||
const CefRect& rect) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return;
|
||||
return m_OSRHandler->OnPopupSize(browser, rect);
|
||||
return osr_handler_->OnPopupSize(browser, rect);
|
||||
}
|
||||
|
||||
void ClientHandler::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||
@@ -606,53 +606,53 @@ void ClientHandler::OnPaint(CefRefPtr<CefBrowser> browser,
|
||||
const void* buffer,
|
||||
int width,
|
||||
int height) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return;
|
||||
m_OSRHandler->OnPaint(browser, type, dirtyRects, buffer, width, height);
|
||||
osr_handler_->OnPaint(browser, type, dirtyRects, buffer, width, height);
|
||||
}
|
||||
|
||||
void ClientHandler::OnCursorChange(CefRefPtr<CefBrowser> browser,
|
||||
CefCursorHandle cursor) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return;
|
||||
m_OSRHandler->OnCursorChange(browser, cursor);
|
||||
osr_handler_->OnCursorChange(browser, cursor);
|
||||
}
|
||||
|
||||
bool ClientHandler::StartDragging(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefDragData> drag_data,
|
||||
CefRenderHandler::DragOperationsMask allowed_ops,
|
||||
int x, int y) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return false;
|
||||
return m_OSRHandler->StartDragging(browser, drag_data, allowed_ops, x, y);
|
||||
return osr_handler_->StartDragging(browser, drag_data, allowed_ops, x, y);
|
||||
}
|
||||
|
||||
void ClientHandler::UpdateDragCursor(CefRefPtr<CefBrowser> browser,
|
||||
CefRenderHandler::DragOperation operation) {
|
||||
if (!m_OSRHandler.get())
|
||||
if (!osr_handler_.get())
|
||||
return;
|
||||
m_OSRHandler->UpdateDragCursor(browser, operation);
|
||||
osr_handler_->UpdateDragCursor(browser, operation);
|
||||
}
|
||||
|
||||
void ClientHandler::SetMainHwnd(ClientWindowHandle hwnd) {
|
||||
void ClientHandler::SetMainWindowHandle(ClientWindowHandle handle) {
|
||||
AutoLock lock_scope(this);
|
||||
m_MainHwnd = hwnd;
|
||||
main_handle_ = handle;
|
||||
}
|
||||
|
||||
void ClientHandler::SetEditHwnd(ClientWindowHandle hwnd) {
|
||||
void ClientHandler::SetEditWindowHandle(ClientWindowHandle handle) {
|
||||
AutoLock lock_scope(this);
|
||||
m_EditHwnd = hwnd;
|
||||
edit_handle_ = handle;
|
||||
}
|
||||
|
||||
void ClientHandler::SetButtonHwnds(ClientWindowHandle backHwnd,
|
||||
ClientWindowHandle forwardHwnd,
|
||||
ClientWindowHandle reloadHwnd,
|
||||
ClientWindowHandle stopHwnd) {
|
||||
void ClientHandler::SetButtonWindowHandles(ClientWindowHandle backHandle,
|
||||
ClientWindowHandle forwardHandle,
|
||||
ClientWindowHandle reloadHandle,
|
||||
ClientWindowHandle stopHandle) {
|
||||
AutoLock lock_scope(this);
|
||||
m_BackHwnd = backHwnd;
|
||||
m_ForwardHwnd = forwardHwnd;
|
||||
m_ReloadHwnd = reloadHwnd;
|
||||
m_StopHwnd = stopHwnd;
|
||||
back_handle_ = backHandle;
|
||||
forward_handle_ = forwardHandle;
|
||||
reload_handle_ = reloadHandle;
|
||||
stop_handle_ = stopHandle;
|
||||
}
|
||||
|
||||
void ClientHandler::CloseAllBrowsers(bool force_close) {
|
||||
@@ -664,32 +664,32 @@ void ClientHandler::CloseAllBrowsers(bool force_close) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_PopupBrowsers.empty()) {
|
||||
if (!popup_browsers_.empty()) {
|
||||
// Request that any popup browsers close.
|
||||
BrowserList::const_iterator it = m_PopupBrowsers.begin();
|
||||
for (; it != m_PopupBrowsers.end(); ++it)
|
||||
BrowserList::const_iterator it = popup_browsers_.begin();
|
||||
for (; it != popup_browsers_.end(); ++it)
|
||||
(*it)->GetHost()->CloseBrowser(force_close);
|
||||
}
|
||||
|
||||
if (m_Browser.get()) {
|
||||
if (browser_.get()) {
|
||||
// Request that the main browser close.
|
||||
m_Browser->GetHost()->CloseBrowser(force_close);
|
||||
browser_->GetHost()->CloseBrowser(force_close);
|
||||
}
|
||||
}
|
||||
|
||||
std::string ClientHandler::GetLogFile() {
|
||||
AutoLock lock_scope(this);
|
||||
return m_LogFile;
|
||||
return log_file_;
|
||||
}
|
||||
|
||||
void ClientHandler::SetLastDownloadFile(const std::string& fileName) {
|
||||
AutoLock lock_scope(this);
|
||||
m_LastDownloadFile = fileName;
|
||||
last_download_file_ = fileName;
|
||||
}
|
||||
|
||||
std::string ClientHandler::GetLastDownloadFile() {
|
||||
AutoLock lock_scope(this);
|
||||
return m_LastDownloadFile;
|
||||
return last_download_file_;
|
||||
}
|
||||
|
||||
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser) {
|
||||
@@ -750,7 +750,8 @@ void ClientHandler::EndTracing() {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnEndTracingComplete(const CefString& tracing_file) OVERRIDE {
|
||||
virtual void OnEndTracingComplete(
|
||||
const CefString& tracing_file) OVERRIDE {
|
||||
handler_->SetLastDownloadFile(tracing_file.ToString());
|
||||
handler_->SendNotification(NOTIFY_DOWNLOAD_COMPLETE);
|
||||
}
|
||||
@@ -808,23 +809,23 @@ void ClientHandler::BuildTestMenu(CefRefPtr<CefMenuModel> model) {
|
||||
submenu->AddRadioItem(CLIENT_ID_TESTMENU_RADIOITEM3, "Radio Item 3", 0);
|
||||
|
||||
// Check the check item.
|
||||
if (m_TestMenuState.check_item)
|
||||
if (test_menu_state_.check_item)
|
||||
submenu->SetChecked(CLIENT_ID_TESTMENU_CHECKITEM, true);
|
||||
|
||||
// Check the selected radio item.
|
||||
submenu->SetChecked(
|
||||
CLIENT_ID_TESTMENU_RADIOITEM1 + m_TestMenuState.radio_item, true);
|
||||
CLIENT_ID_TESTMENU_RADIOITEM1 + test_menu_state_.radio_item, true);
|
||||
}
|
||||
|
||||
bool ClientHandler::ExecuteTestMenu(int command_id) {
|
||||
if (command_id == CLIENT_ID_TESTMENU_CHECKITEM) {
|
||||
// Toggle the check item.
|
||||
m_TestMenuState.check_item ^= 1;
|
||||
test_menu_state_.check_item ^= 1;
|
||||
return true;
|
||||
} else if (command_id >= CLIENT_ID_TESTMENU_RADIOITEM1 &&
|
||||
command_id <= CLIENT_ID_TESTMENU_RADIOITEM3) {
|
||||
// Store the selected radio item.
|
||||
m_TestMenuState.radio_item = (command_id - CLIENT_ID_TESTMENU_RADIOITEM1);
|
||||
test_menu_state_.radio_item = (command_id - CLIENT_ID_TESTMENU_RADIOITEM1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user