Update all files to use Windows CRLF (\r\n) line endings (issue #45).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@33 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2009-07-24 19:11:01 +00:00
parent 6a7b6d5038
commit ea3a49abe1
72 changed files with 7757 additions and 7757 deletions

View File

@ -1,8 +1,8 @@
// Copyright (c) 2008-2009 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Copyright (c) 2008-2009 The Chromium Embedded Framework Authors.
// Portions copyright (c) 2006-2008 The Chromium 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 "precompiled_libcef.h"
#include "context.h"
#include "browser_impl.h"
@ -41,25 +41,25 @@ CefBrowserImpl::CefBrowserImpl(CefWindowInfo& windowInfo, bool popup,
void CefBrowserImpl::GoBack()
{
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_BACK));
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_BACK));
}
void CefBrowserImpl::GoForward()
{
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_FORWARD));
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_FORWARD));
}
void CefBrowserImpl::Reload()
{
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_RELOAD));
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_RELOAD));
}
void CefBrowserImpl::StopLoad()
{
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_STOP));
&CefBrowserImpl::UIT_HandleActionView, MENU_ID_NAV_STOP));
}
void CefBrowserImpl::SetFocus(bool enable)
@ -167,8 +167,8 @@ void CefBrowserImpl::RemoveCefFrame(const std::wstring& name)
WebFrame* CefBrowserImpl::GetWebFrame(CefRefPtr<CefFrame> frame)
{
std::wstring name = frame->GetName();
if(name.empty())
return GetWebView()->GetMainFrame();
if(name.empty())
return GetWebView()->GetMainFrame();
return GetWebView()->GetFrameWithName(name);
}
@ -176,49 +176,49 @@ void CefBrowserImpl::Undo(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_UNDO, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_UNDO, frame.get()));
}
void CefBrowserImpl::Redo(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_REDO, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_REDO, frame.get()));
}
void CefBrowserImpl::Cut(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_CUT, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_CUT, frame.get()));
}
void CefBrowserImpl::Copy(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_COPY, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_COPY, frame.get()));
}
void CefBrowserImpl::Paste(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_PASTE, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_PASTE, frame.get()));
}
void CefBrowserImpl::Delete(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_DELETE, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_DELETE, frame.get()));
}
void CefBrowserImpl::SelectAll(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_SELECTALL, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_SELECTALL, frame.get()));
}
@ -226,14 +226,14 @@ void CefBrowserImpl::Print(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_PRINT, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_PRINT, frame.get()));
}
void CefBrowserImpl::ViewSource(CefRefPtr<CefFrame> frame)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_HandleAction, MENU_ID_VIEWSOURCE, frame.get()));
&CefBrowserImpl::UIT_HandleAction, MENU_ID_VIEWSOURCE, frame.get()));
}
void CefBrowserImpl::LoadRequest(CefRefPtr<CefFrame> frame,
@ -278,12 +278,12 @@ void CefBrowserImpl::LoadStream(CefRefPtr<CefFrame> frame,
void CefBrowserImpl::ExecuteJavaScript(CefRefPtr<CefFrame> frame,
const std::wstring& jsCode,
const std::wstring& scriptUrl,
int startLine)
{
int startLine)
{
frame->AddRef();
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_ExecuteJavaScript, frame.get(), jsCode, scriptUrl,
startLine));
PostTask(FROM_HERE, NewRunnableMethod(this,
&CefBrowserImpl::UIT_ExecuteJavaScript, frame.get(), jsCode, scriptUrl,
startLine));
}
std::wstring CefBrowserImpl::GetURL(CefRefPtr<CefFrame> frame)
@ -309,10 +309,10 @@ bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, bool popup,
// or cancel the window creation.
CefHandler::RetVal rv =
handler->HandleBeforeCreated(NULL, windowInfo, popup, handler, newUrl);
if(rv == RV_HANDLED)
if(rv == RV_HANDLED)
return false;
}
}
CefRefPtr<CefBrowserImpl> browser(
new CefBrowserImpl(windowInfo, popup, handler));
PostTask(FROM_HERE, NewRunnableMethod(browser.get(),
@ -337,7 +337,7 @@ CefRefPtr<CefBrowser> CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo,
// or cancel the window creation.
CefHandler::RetVal rv = handler->HandleBeforeCreated(NULL, windowInfo,
popup, handler, newUrl);
if(rv == RV_HANDLED)
if(rv == RV_HANDLED)
return false;
}
@ -347,327 +347,327 @@ CefRefPtr<CefBrowser> CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo,
return browser;
}
void CefBrowserImpl::UIT_LoadURL(CefFrame* frame,
const std::wstring& url)
{
UIT_LoadURLForRequest(frame, url, std::wstring(), WebHTTPBody(),
CefRequest::HeaderMap());
}
void CefBrowserImpl::UIT_LoadURLForRequestRef(CefFrame* frame,
CefRequest* request)
{
std::wstring url = request->GetURL();
std::wstring method = request->GetMethod();
CefRequestImpl *impl = static_cast<CefRequestImpl*>(request);
WebHTTPBody upload_data;
CefRefPtr<CefPostData> postdata = impl->GetPostData();
if(postdata.get()) {
upload_data.initialize();
static_cast<CefPostDataImpl*>(postdata.get())->Get(upload_data);
}
CefRequest::HeaderMap headers;
impl->GetHeaderMap(headers);
UIT_LoadURLForRequest(frame, url, method, upload_data, headers);
request->Release();
}
void CefBrowserImpl::UIT_LoadURLForRequest(CefFrame* frame,
const std::wstring& url,
const std::wstring& method,
const WebKit::WebHTTPBody& upload_data,
const CefRequest::HeaderMap& headers)
{
void CefBrowserImpl::UIT_LoadURL(CefFrame* frame,
const std::wstring& url)
{
UIT_LoadURLForRequest(frame, url, std::wstring(), WebHTTPBody(),
CefRequest::HeaderMap());
}
void CefBrowserImpl::UIT_LoadURLForRequestRef(CefFrame* frame,
CefRequest* request)
{
std::wstring url = request->GetURL();
std::wstring method = request->GetMethod();
CefRequestImpl *impl = static_cast<CefRequestImpl*>(request);
WebHTTPBody upload_data;
CefRefPtr<CefPostData> postdata = impl->GetPostData();
if(postdata.get()) {
upload_data.initialize();
static_cast<CefPostDataImpl*>(postdata.get())->Get(upload_data);
}
CefRequest::HeaderMap headers;
impl->GetHeaderMap(headers);
UIT_LoadURLForRequest(frame, url, method, upload_data, headers);
request->Release();
}
void CefBrowserImpl::UIT_LoadURLForRequest(CefFrame* frame,
const std::wstring& url,
const std::wstring& method,
const WebKit::WebHTTPBody& upload_data,
const CefRequest::HeaderMap& headers)
{
REQUIRE_UIT();
if (url.empty())
return;
GURL gurl(url);
if (!gurl.is_valid() && !gurl.has_scheme()) {
// Try to add "http://" at the beginning
gurl = GURL(std::wstring(L"http://") + url);
if (!gurl.is_valid())
return;
}
nav_controller_->LoadEntry(
new BrowserNavigationEntry(-1, gurl, std::wstring(), frame->GetName(),
method, upload_data, headers));
frame->Release();
}
void CefBrowserImpl::UIT_LoadHTML(CefFrame* frame,
const std::wstring& html,
const std::wstring& url)
{
if (url.empty())
return;
GURL gurl(url);
if (!gurl.is_valid() && !gurl.has_scheme()) {
// Try to add "http://" at the beginning
gurl = GURL(std::wstring(L"http://") + url);
if (!gurl.is_valid())
return;
}
nav_controller_->LoadEntry(
new BrowserNavigationEntry(-1, gurl, std::wstring(), frame->GetName(),
method, upload_data, headers));
frame->Release();
}
void CefBrowserImpl::UIT_LoadHTML(CefFrame* frame,
const std::wstring& html,
const std::wstring& url)
{
REQUIRE_UIT();
GURL gurl(url);
if (!gurl.is_valid() && !gurl.has_scheme()) {
// Try to add "http://" at the beginning
gurl = GURL(std::wstring(L"http://") + url);
if (!gurl.is_valid())
return;
}
WebFrame* web_frame = GetWebFrame(frame);
if(web_frame)
web_frame->LoadHTMLString(WideToUTF8(html), gurl);
frame->Release();
}
void CefBrowserImpl::UIT_LoadHTMLForStreamRef(CefFrame* frame,
CefStreamReader* stream,
const std::wstring& url)
{
GURL gurl(url);
if (!gurl.is_valid() && !gurl.has_scheme()) {
// Try to add "http://" at the beginning
gurl = GURL(std::wstring(L"http://") + url);
if (!gurl.is_valid())
return;
}
WebFrame* web_frame = GetWebFrame(frame);
if(web_frame)
web_frame->LoadHTMLString(WideToUTF8(html), gurl);
frame->Release();
}
void CefBrowserImpl::UIT_LoadHTMLForStreamRef(CefFrame* frame,
CefStreamReader* stream,
const std::wstring& url)
{
REQUIRE_UIT();
GURL gurl(url);
if (!gurl.is_valid() && !gurl.has_scheme()) {
// Try to add "http://" at the beginning
gurl = GURL(std::wstring(L"http://") + url);
if (!gurl.is_valid())
return;
}
// read all of the stream data into a std::string.
std::stringstream ss;
char buff[BUFFER_SIZE];
size_t read;
do {
read = stream->Read(buff, sizeof(char), BUFFER_SIZE-1);
if(read > 0) {
buff[read] = 0;
ss << buff;
}
}
while(read > 0);
WebFrame* web_frame = GetWebFrame(frame);
if(web_frame)
web_frame->LoadHTMLString(ss.str(), gurl);
stream->Release();
frame->Release();
}
void CefBrowserImpl::UIT_ExecuteJavaScript(CefFrame* frame,
GURL gurl(url);
if (!gurl.is_valid() && !gurl.has_scheme()) {
// Try to add "http://" at the beginning
gurl = GURL(std::wstring(L"http://") + url);
if (!gurl.is_valid())
return;
}
// read all of the stream data into a std::string.
std::stringstream ss;
char buff[BUFFER_SIZE];
size_t read;
do {
read = stream->Read(buff, sizeof(char), BUFFER_SIZE-1);
if(read > 0) {
buff[read] = 0;
ss << buff;
}
}
while(read > 0);
WebFrame* web_frame = GetWebFrame(frame);
if(web_frame)
web_frame->LoadHTMLString(ss.str(), gurl);
stream->Release();
frame->Release();
}
void CefBrowserImpl::UIT_ExecuteJavaScript(CefFrame* frame,
const std::wstring& js_code,
const std::wstring& script_url,
int start_line)
{
REQUIRE_UIT();
WebFrame* web_frame = GetWebFrame(frame);
if(web_frame) {
web_frame->ExecuteScript(
WebScriptSource(WebString(js_code), WebURL(GURL(script_url)),
start_line));
}
frame->Release();
}
void CefBrowserImpl::UIT_GoBackOrForward(int offset)
{
int start_line)
{
REQUIRE_UIT();
nav_controller_->GoToOffset(offset);
}
void CefBrowserImpl::UIT_Reload()
{
WebFrame* web_frame = GetWebFrame(frame);
if(web_frame) {
web_frame->ExecuteScript(
WebScriptSource(WebString(js_code), WebURL(GURL(script_url)),
start_line));
}
frame->Release();
}
void CefBrowserImpl::UIT_GoBackOrForward(int offset)
{
REQUIRE_UIT();
nav_controller_->Reload();
}
nav_controller_->GoToOffset(offset);
}
void CefBrowserImpl::UIT_Reload()
{
REQUIRE_UIT();
nav_controller_->Reload();
}
bool CefBrowserImpl::UIT_Navigate(const BrowserNavigationEntry& entry,
bool reload)
{
REQUIRE_UIT();
// Get the right target frame for the entry.
WebFrame* frame;
if (!entry.GetTargetFrame().empty())
frame = GetWebView()->GetFrameWithName(entry.GetTargetFrame());
else
frame = GetWebView()->GetMainFrame();
// TODO(mpcomplete): should we clear the target frame, or should
// back/forward navigations maintain the target frame?
// A navigation resulting from loading a javascript URL should not be
// treated as a browser initiated event. Instead, we want it to look as if
// the page initiated any load resulting from JS execution.
if (!entry.GetURL().SchemeIs("javascript")) {
delegate_->set_pending_extra_data(
new BrowserExtraData(entry.GetPageID()));
}
// If we are reloading, then WebKit will use the state of the current page.
// Otherwise, we give it the state to navigate to.
if (reload) {
frame->Reload();
} else if (!entry.GetContentState().empty()) {
DCHECK(entry.GetPageID() != -1);
frame->LoadHistoryItem(
webkit_glue::HistoryItemFromString(entry.GetContentState()));
} else {
DCHECK(entry.GetPageID() == -1);
WebURLRequest request(entry.GetURL());
if(entry.GetMethod().size() > 0) {
request.setHTTPMethod(
StdStringToWebString(WideToUTF8(entry.GetMethod())));
}
if(entry.GetHeaders().size() > 0)
CefRequestImpl::SetHeaderMap(entry.GetHeaders(), request);
if(!entry.GetUploadData().isNull())
{
std::string method = WebStringToStdString(request.httpMethod());
if(method == "GET" || method == "HEAD") {
request.setHTTPMethod(StdStringToWebString("POST"));
}
if(request.httpHeaderField(StdStringToWebString("Content-Type")).length()
== 0) {
request.setHTTPHeaderField(
StdStringToWebString("Content-Type"),
StdStringToWebString("application/x-www-form-urlencoded"));
}
request.setHTTPBody(entry.GetUploadData());
}
frame->LoadRequest(request);
}
// In case LoadRequest failed before DidCreateDataSource was called.
delegate_->set_pending_extra_data(NULL);
if (handler_.get() && handler_->HandleSetFocus(this, false) == RV_CONTINUE) {
// Restore focus to the main frame prior to loading new request.
// This makes sure that we don't have a focused iframe. Otherwise, that
// iframe would keep focus when the SetFocus called immediately after
// LoadRequest, thus making some tests fail (see http://b/issue?id=845337
// for more details).
// TODO(cef): The above comment may be wrong, or the below call to
// SetFocusedFrame() may be unnecessary or in the wrong place. See this
// thread for additional details:
// http://groups.google.com/group/chromium-dev/browse_thread/thread/42bcd31b59e3a168
GetWebView()->SetFocusedFrame(frame);
UIT_SetFocus(GetWebViewHost(), true);
}
// Get the right target frame for the entry.
WebFrame* frame;
if (!entry.GetTargetFrame().empty())
frame = GetWebView()->GetFrameWithName(entry.GetTargetFrame());
else
frame = GetWebView()->GetMainFrame();
// TODO(mpcomplete): should we clear the target frame, or should
// back/forward navigations maintain the target frame?
// A navigation resulting from loading a javascript URL should not be
// treated as a browser initiated event. Instead, we want it to look as if
// the page initiated any load resulting from JS execution.
if (!entry.GetURL().SchemeIs("javascript")) {
delegate_->set_pending_extra_data(
new BrowserExtraData(entry.GetPageID()));
}
// If we are reloading, then WebKit will use the state of the current page.
// Otherwise, we give it the state to navigate to.
if (reload) {
frame->Reload();
} else if (!entry.GetContentState().empty()) {
DCHECK(entry.GetPageID() != -1);
frame->LoadHistoryItem(
webkit_glue::HistoryItemFromString(entry.GetContentState()));
} else {
DCHECK(entry.GetPageID() == -1);
WebURLRequest request(entry.GetURL());
if(entry.GetMethod().size() > 0) {
request.setHTTPMethod(
StdStringToWebString(WideToUTF8(entry.GetMethod())));
}
if(entry.GetHeaders().size() > 0)
CefRequestImpl::SetHeaderMap(entry.GetHeaders(), request);
if(!entry.GetUploadData().isNull())
{
std::string method = WebStringToStdString(request.httpMethod());
if(method == "GET" || method == "HEAD") {
request.setHTTPMethod(StdStringToWebString("POST"));
}
if(request.httpHeaderField(StdStringToWebString("Content-Type")).length()
== 0) {
request.setHTTPHeaderField(
StdStringToWebString("Content-Type"),
StdStringToWebString("application/x-www-form-urlencoded"));
}
request.setHTTPBody(entry.GetUploadData());
}
frame->LoadRequest(request);
}
// In case LoadRequest failed before DidCreateDataSource was called.
delegate_->set_pending_extra_data(NULL);
if (handler_.get() && handler_->HandleSetFocus(this, false) == RV_CONTINUE) {
// Restore focus to the main frame prior to loading new request.
// This makes sure that we don't have a focused iframe. Otherwise, that
// iframe would keep focus when the SetFocus called immediately after
// LoadRequest, thus making some tests fail (see http://b/issue?id=845337
// for more details).
// TODO(cef): The above comment may be wrong, or the below call to
// SetFocusedFrame() may be unnecessary or in the wrong place. See this
// thread for additional details:
// http://groups.google.com/group/chromium-dev/browse_thread/thread/42bcd31b59e3a168
GetWebView()->SetFocusedFrame(frame);
UIT_SetFocus(GetWebViewHost(), true);
}
return true;
}
CefRefPtr<CefBrowserImpl> CefBrowserImpl::UIT_CreatePopupWindow(const std::wstring& url)
{
CefRefPtr<CefBrowserImpl> CefBrowserImpl::UIT_CreatePopupWindow(const std::wstring& url)
{
REQUIRE_UIT();
CefWindowInfo info;
info.SetAsPopup(NULL, url.c_str());
CefRefPtr<CefHandler> handler = handler_;
std::wstring newUrl = url;
CefWindowInfo info;
info.SetAsPopup(NULL, url.c_str());
CefRefPtr<CefHandler> handler = handler_;
std::wstring newUrl = url;
if(handler_.get())
{
// Give the handler an opportunity to modify window attributes, handler,
// or cancel the window creation.
CefHandler::RetVal rv =
handler_->HandleBeforeCreated(this, info, true, handler, newUrl);
if(rv == RV_HANDLED)
if(rv == RV_HANDLED)
return NULL;
}
}
CefRefPtr<CefBrowserImpl> browser(new CefBrowserImpl(info, true, handler));
browser->UIT_CreateBrowser(newUrl);
return browser;
}
void CefBrowserImpl::UIT_Show(WebKit::WebNavigationPolicy policy)
{
browser->UIT_CreateBrowser(newUrl);
return browser;
}
void CefBrowserImpl::UIT_Show(WebKit::WebNavigationPolicy policy)
{
REQUIRE_UIT();
delegate_->show(policy);
}
void CefBrowserImpl::UIT_HandleActionView(CefHandler::MenuId menuId)
{
return UIT_HandleAction(menuId, NULL);
}
void CefBrowserImpl::UIT_HandleAction(CefHandler::MenuId menuId,
CefFrame* frame)
{
delegate_->show(policy);
}
void CefBrowserImpl::UIT_HandleActionView(CefHandler::MenuId menuId)
{
return UIT_HandleAction(menuId, NULL);
}
void CefBrowserImpl::UIT_HandleAction(CefHandler::MenuId menuId,
CefFrame* frame)
{
REQUIRE_UIT();
WebFrame* web_frame = NULL;
if(frame)
web_frame = GetWebFrame(frame);
switch(menuId)
{
case MENU_ID_NAV_BACK:
UIT_GoBackOrForward(-1);
break;
case MENU_ID_NAV_FORWARD:
UIT_GoBackOrForward(1);
break;
case MENU_ID_NAV_RELOAD:
UIT_Reload();
break;
case MENU_ID_NAV_STOP:
GetWebView()->StopLoading();
break;
case MENU_ID_UNDO:
if(web_frame)
web_frame->Undo();
break;
case MENU_ID_REDO:
if(web_frame)
web_frame->Redo();
break;
case MENU_ID_CUT:
if(web_frame)
web_frame->Cut();
break;
case MENU_ID_COPY:
if(web_frame)
web_frame->Copy();
break;
case MENU_ID_PASTE:
if(web_frame)
web_frame->Paste();
break;
case MENU_ID_DELETE:
if(web_frame)
web_frame->Delete();
break;
case MENU_ID_SELECTALL:
if(web_frame)
web_frame->SelectAll();
break;
case MENU_ID_PRINT:
if(web_frame)
UIT_PrintPages(web_frame);
break;
case MENU_ID_VIEWSOURCE:
if(web_frame)
UIT_ViewDocumentString(web_frame);
break;
}
if(frame)
frame->Release();
}
WebFrame* web_frame = NULL;
if(frame)
web_frame = GetWebFrame(frame);
switch(menuId)
{
case MENU_ID_NAV_BACK:
UIT_GoBackOrForward(-1);
break;
case MENU_ID_NAV_FORWARD:
UIT_GoBackOrForward(1);
break;
case MENU_ID_NAV_RELOAD:
UIT_Reload();
break;
case MENU_ID_NAV_STOP:
GetWebView()->StopLoading();
break;
case MENU_ID_UNDO:
if(web_frame)
web_frame->Undo();
break;
case MENU_ID_REDO:
if(web_frame)
web_frame->Redo();
break;
case MENU_ID_CUT:
if(web_frame)
web_frame->Cut();
break;
case MENU_ID_COPY:
if(web_frame)
web_frame->Copy();
break;
case MENU_ID_PASTE:
if(web_frame)
web_frame->Paste();
break;
case MENU_ID_DELETE:
if(web_frame)
web_frame->Delete();
break;
case MENU_ID_SELECTALL:
if(web_frame)
web_frame->SelectAll();
break;
case MENU_ID_PRINT:
if(web_frame)
UIT_PrintPages(web_frame);
break;
case MENU_ID_VIEWSOURCE:
if(web_frame)
UIT_ViewDocumentString(web_frame);
break;
}
if(frame)
frame->Release();
}