Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc

Issue 7206055: Add an option to run Chrome in the views desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc
===================================================================
--- chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc (revision 0)
+++ chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.cc (revision 0)
@@ -0,0 +1,88 @@
+// Copyright (c) 2011 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 "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h"
+
+#include "chrome/browser/renderer_host/render_widget_host_view_views.h"
+#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h"
+#include "content/browser/tab_contents/tab_contents.h"
+#include "content/browser/tab_contents/tab_contents_view.h"
+#include "views/widget/widget.h"
+
+// TODO(beng): HiddenTabHostWindow??
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeTabContentsViewViews, public:
+
+NativeTabContentsViewViews::NativeTabContentsViewViews(
+ internal::NativeTabContentsViewDelegate* delegate)
+ : views::NativeWidgetViews(delegate->AsNativeWidgetDelegate()),
+ delegate_(delegate) {
+}
+
+NativeTabContentsViewViews::~NativeTabContentsViewViews() {
+ CloseNow();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeTabContentsViewViews, NativeTabContentsView implementation:
+
+void NativeTabContentsViewViews::InitNativeTabContentsView() {
+ views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
+ params.native_widget = this;
+ params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
+ GetWidget()->Init(params);
+}
+
+void NativeTabContentsViewViews::Unparent() {
+ // Note that we do not DCHECK on focus_manager_ as it may be NULL when used
+ // with an external tab container.
+ views::Widget::ReparentNativeView(GetNativeView(), NULL);
+}
+
+RenderWidgetHostView* NativeTabContentsViewViews::CreateRenderWidgetHostView(
+ RenderWidgetHost* render_widget_host) {
+ RenderWidgetHostViewViews* view =
+ new RenderWidgetHostViewViews(render_widget_host);
+ GetWidget()->SetContentsView(view);
+ view->Show();
+ view->InitAsChild();
+ // TODO(anicolao): implement drag'n'drop hooks if needed
+ return view;
+}
+
+gfx::NativeWindow NativeTabContentsViewViews::GetTopLevelNativeWindow() const {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void NativeTabContentsViewViews::SetPageTitle(const std::wstring& title) {
+ SetWindowTitle(title);
+}
+
+void NativeTabContentsViewViews::StartDragging(
+ const WebDropData& drop_data,
+ WebKit::WebDragOperationsMask ops,
+ const SkBitmap& image,
+ const gfx::Point& image_offset) {
+ NOTIMPLEMENTED();
+}
+
+void NativeTabContentsViewViews::CancelDrag() {
+ NOTIMPLEMENTED();
+}
+
+bool NativeTabContentsViewViews::IsDoingDrag() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void NativeTabContentsViewViews::SetDragCursor(
+ WebKit::WebDragOperation operation) {
+ NOTIMPLEMENTED();
+}
+
+views::NativeWidget* NativeTabContentsViewViews::AsNativeWidget() {
+ return this;
+}
Property changes on: chrome\browser\ui\views\tab_contents\native_tab_contents_view_views.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698