cef/libcef/response_impl.cc
Marshall Greenblatt a125c0d964 - Add CefWebURLRequest implementation (issue #51).
- Default new CefRequest objects to the "GET" method.
- Send URL and title change notifications for CefFrame::LoadString().
- Disable the RequestTest.HistoryNav test which requires WebKit patches.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@184 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-02-09 22:04:35 +00:00

51 lines
1.2 KiB
C++

// Copyright (c) 2011 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 "include/cef.h"
#include "response_impl.h"
#include "base/logging.h"
#include "http_header_utils.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
CefResponseImpl::CefResponseImpl(const WebKit::WebURLResponse &response)
{
DCHECK(!response.isNull());
WebKit::WebString str;
status_code_ = response.httpStatusCode();
str = response.httpStatusText();
status_text_ = CefString(str);
HttpHeaderUtils::HeaderVisitor visitor(&header_map_);
response.visitHTTPHeaderFields(&visitor);
}
int CefResponseImpl::GetStatus()
{
return status_code_;
}
CefString CefResponseImpl::GetStatusText()
{
return status_text_;
}
CefString CefResponseImpl::GetHeader(const CefString& name)
{
CefString value;
HeaderMap::const_iterator it = header_map_.find(name);
if (it != header_map_.end())
value = it->second;
return value;
}
void CefResponseImpl::GetHeaderMap(HeaderMap& map)
{
map = header_map_;
}