1
// vim:expandtab:shiftwidth=2:tabstop=2:
2
// Copyright (C) 2013 Canonical Ltd.
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either
7
// version 2.1 of the License, or (at your option) any later version.
9
// This library is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// Lesser General Public License for more details.
14
// You should have received a copy of the GNU Lesser General Public
15
// License along with this library; if not, write to the Free Software
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
#include "oxide_web_contents_view.h"
20
#include "content/public/browser/render_widget_host_view.h"
21
#include "content/public/browser/web_contents.h"
23
#include "oxide_web_contents_view_delegate.h"
27
WebContentsView::WebContentsView(content::WebContents* web_contents) :
28
web_contents_(web_contents),
31
WebContentsView::~WebContentsView() {}
33
void WebContentsView::CreateView(const gfx::Size& initial_size,
34
gfx::NativeView context) {
35
requested_size_ = initial_size;
38
content::RenderWidgetHostView* WebContentsView::CreateViewForWidget(
39
content::RenderWidgetHost* render_widget_host) {
41
return delegate_->CreateViewForWidget(render_widget_host);
47
content::RenderWidgetHostView* WebContentsView::CreateViewForPopupWidget(
48
content::RenderWidgetHost* render_widget_host) {
52
void WebContentsView::SetPageTitle(const string16& title) {}
54
void WebContentsView::RenderViewCreated(content::RenderViewHost* host) {}
56
void WebContentsView::RenderViewSwappedIn(content::RenderViewHost* host) {}
58
void WebContentsView::SetOverscrollControllerEnabled(bool enabled) {}
60
gfx::NativeView WebContentsView::GetNativeView() const {
64
gfx::NativeView WebContentsView::GetContentNativeView() const {
68
gfx::NativeWindow WebContentsView::GetTopLevelNativeWindow() const {
72
void WebContentsView::GetContainerBounds(gfx::Rect* out) const {
74
*out = delegate_->GetContainerBounds();
80
void WebContentsView::OnTabCrashed(base::TerminationStatus status,
83
void WebContentsView::SizeContents(const gfx::Size& size) {
84
requested_size_ = size;
86
content::RenderWidgetHostView* rwhv =
87
web_contents_->GetRenderWidgetHostView();
93
void WebContentsView::Focus() {
94
content::RenderWidgetHostView* rwhv =
95
web_contents_->GetRenderWidgetHostView();
101
void WebContentsView::SetInitialFocus() {}
103
void WebContentsView::StoreFocus() {}
105
void WebContentsView::RestoreFocus() {}
107
content::DropData* WebContentsView::GetDropData() const {
111
gfx::Rect WebContentsView::GetViewBounds() const {
112
content::RenderWidgetHostView* rwhv =
113
web_contents_->GetRenderWidgetHostView();
115
return rwhv->GetViewBounds();
121
void WebContentsView::ShowPopupMenu(const gfx::Rect& bounds,
123
double item_font_size,
125
const std::vector<WebMenuItem>& items,
127
bool allow_multiple_selection) {}
129
void WebContentsView::SetDelegate(WebContentsViewDelegate* delegate) {
130
delegate_ = delegate;