// Copyright (c) 2013 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 "tests/cefsimple/simple_handler.h" #import #include "include/cef_browser.h" namespace { NSWindow* GetNSWindowForBrowser(CefRefPtr browser) { NSView* view = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(browser->GetHost()->GetWindowHandle()); return [view window]; } } // namespace void SimpleHandler::PlatformTitleChange(CefRefPtr browser, const CefString& title) { NSWindow* window = GetNSWindowForBrowser(browser); std::string titleStr(title); NSString* str = [NSString stringWithUTF8String:titleStr.c_str()]; [window setTitle:str]; } void SimpleHandler::PlatformShowWindow(CefRefPtr browser) { NSWindow* window = GetNSWindowForBrowser(browser); [window makeKeyAndOrderFront:window]; }