Ignore title changes from dev tools client

Previously the generic developer tools message
would be set as the window title when opened
and only removed once the active edit session was
changed.
This commit is contained in:
Kevin Sawicki
2013-02-06 15:58:39 -08:00
parent b333cf2734
commit c69e217192
4 changed files with 7 additions and 3 deletions

View File

@@ -17,8 +17,9 @@
AtomCefClient::AtomCefClient(){
}
AtomCefClient::AtomCefClient(bool handlePasteboardCommands) {
AtomCefClient::AtomCefClient(bool handlePasteboardCommands, bool ignoreTitleChanges) {
m_HandlePasteboardCommands = handlePasteboardCommands;
m_IgnoreTitleChanges = ignoreTitleChanges;
}
AtomCefClient::~AtomCefClient() {

View File

@@ -16,7 +16,7 @@ class AtomCefClient : public CefClient,
public CefRequestHandler {
public:
AtomCefClient();
AtomCefClient(bool handlePasteboardCommands);
AtomCefClient(bool handlePasteboardCommands, bool ignoreTitleChanges);
virtual ~AtomCefClient();
CefRefPtr<CefBrowser> GetBrowser() { return m_Browser; }
@@ -103,6 +103,7 @@ class AtomCefClient : public CefClient,
protected:
CefRefPtr<CefBrowser> m_Browser;
bool m_HandlePasteboardCommands = false;
bool m_IgnoreTitleChanges = false;
void FocusNextWindow();
void FocusPreviousWindow();

View File

@@ -99,6 +99,8 @@ void AtomCefClient::Confirm(int replyId,
void AtomCefClient::OnTitleChange(CefRefPtr<CefBrowser> browser, const CefString& title) {
if (m_IgnoreTitleChanges) return;
NSWindow *window = [browser->GetHost()->GetWindowHandle() window];
[window setTitle:[NSString stringWithUTF8String:title.ToString().c_str()]];
}

View File

@@ -146,7 +146,7 @@
[_splitView addSubview:_devToolsView];
[_splitView adjustSubviews];
_cefDevToolsClient = new AtomCefClient(true);
_cefDevToolsClient = new AtomCefClient(true, true);
std::string devtools_url = _cefClient->GetBrowser()->GetHost()->GetDevToolsURL(true);
[self addBrowserToView:_devToolsView url:devtools_url.c_str() cefHandler:_cefDevToolsClient];
}