summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 15:51:48 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 15:51:48 +0000
commit93473908574140b04150a159a09b243be3dd0bfe (patch)
treeae4199b73617a6bea11c178c93746b1c3f15317a
parentf34a9058aa124789ebc5b1e38d9d890c29f49ce5 (diff)
downloadchromium_src-93473908574140b04150a159a09b243be3dd0bfe.zip
chromium_src-93473908574140b04150a159a09b243be3dd0bfe.tar.gz
chromium_src-93473908574140b04150a159a09b243be3dd0bfe.tar.bz2
Remove NativeTabContentsContainerGtk since it's not used on any platform.
Review URL: https://chromiumcodereview.appspot.com/9605034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125390 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc145
-rw-r--r--chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.h49
-rw-r--r--chrome/chrome_browser.gypi4
3 files changed, 0 insertions, 198 deletions
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc
deleted file mode 100644
index 77abc80..0000000
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2012 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_container_gtk.h"
-
-#include "chrome/browser/ui/view_ids.h"
-#include "chrome/browser/ui/views/tab_contents/tab_contents_container.h"
-#include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h"
-#include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/web_contents.h"
-#include "ui/base/accessibility/accessible_view_state.h"
-#include "ui/views/focus/focus_manager.h"
-
-using content::RenderViewHost;
-using content::WebContents;
-
-////////////////////////////////////////////////////////////////////////////////
-// NativeTabContentsContainerGtk, public:
-
-NativeTabContentsContainerGtk::NativeTabContentsContainerGtk(
- TabContentsContainer* container)
- : container_(container),
- focus_callback_id_(0) {
- set_id(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW);
-}
-
-NativeTabContentsContainerGtk::~NativeTabContentsContainerGtk() {
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// NativeTabContentsContainerGtk, NativeTabContentsContainer overrides:
-
-void NativeTabContentsContainerGtk::AttachContents(WebContents* contents) {
- Attach(contents->GetNativeView());
-}
-
-void NativeTabContentsContainerGtk::DetachContents(WebContents* contents) {
- gtk_widget_hide(contents->GetNativeView());
-
- // Now detach the TabContents.
- Detach();
-}
-
-void NativeTabContentsContainerGtk::SetFastResize(bool fast_resize) {
- set_fast_resize(fast_resize);
-}
-
-bool NativeTabContentsContainerGtk::GetFastResize() const {
- return fast_resize();
-}
-
-bool NativeTabContentsContainerGtk::FastResizeAtLastLayout() const {
- return fast_resize_at_last_layout();
-}
-
-void NativeTabContentsContainerGtk::RenderViewHostChanged(
- RenderViewHost* old_host,
- RenderViewHost* new_host) {
- // If we are focused, we need to pass the focus to the new RenderViewHost.
- if (GetFocusManager()->GetFocusedView() == this)
- OnFocus();
-}
-
-views::View* NativeTabContentsContainerGtk::GetView() {
- return this;
-}
-
-void NativeTabContentsContainerGtk::WebContentsFocused(WebContents* contents) {
- // Called when the tab contents native view gets focused (typically through a
- // user click). We make ourself the focused view, so the focus is restored
- // properly when the browser window is deactivated/reactivated.
- views::FocusManager* focus_manager = GetFocusManager();
- if (!focus_manager) {
- NOTREACHED();
- return;
- }
- focus_manager->SetFocusedView(this);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// NativeTabContentsContainerGtk, views::View overrides:
-
-bool NativeTabContentsContainerGtk::SkipDefaultKeyEventProcessing(
- const views::KeyEvent& e) {
- // Don't look-up accelerators or tab-traverse if we are showing a non-crashed
- // TabContents.
- // We'll first give the page a chance to process the key events. If it does
- // not process them, they'll be returned to us and we'll treat them as
- // accelerators then.
- return container_->web_contents() &&
- !container_->web_contents()->IsCrashed();
-}
-
-views::FocusTraversable* NativeTabContentsContainerGtk::GetFocusTraversable() {
- return NULL;
-}
-
-bool NativeTabContentsContainerGtk::IsFocusable() const {
- // We need to be focusable when our contents is not a view hierarchy, as
- // clicking on the contents needs to focus us.
- return container_->web_contents() != NULL;
-}
-
-void NativeTabContentsContainerGtk::OnFocus() {
- if (container_->web_contents())
- container_->web_contents()->Focus();
-}
-
-void NativeTabContentsContainerGtk::RequestFocus() {
- // This is a hack to circumvent the fact that a view does not explicitly get
- // a call to set the focus if it already has the focus. This causes a problem
- // with tabs such as the TabContents that instruct the RenderView that it got
- // focus when they actually get the focus. When switching from one TabContents
- // tab that has focus to another TabContents tab that had focus, since the
- // TabContentsContainerView already has focus, OnFocus() would not be called
- // and the RenderView would not get notified it got focused.
- // By clearing the focused view before-hand, we ensure OnFocus() will be
- // called.
- views::FocusManager* focus_manager = GetFocusManager();
- if (focus_manager)
- focus_manager->SetFocusedView(NULL);
- View::RequestFocus();
-}
-
-void NativeTabContentsContainerGtk::AboutToRequestFocusFromTabTraversal(
- bool reverse) {
- if (!container_->web_contents())
- return;
- container_->web_contents()->FocusThroughTabTraversal(reverse);
-}
-
-void NativeTabContentsContainerGtk::GetAccessibleState(
- ui::AccessibleViewState* state) {
- state->role = ui::AccessibilityTypes::ROLE_GROUPING;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// NativeTabContentsContainer, public:
-
-// static
-NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer(
- TabContentsContainer* container) {
- return new NativeTabContentsContainerGtk(container);
-}
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.h b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.h
deleted file mode 100644
index a6fe8ad..0000000
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// 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.
-
-#ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_GTK_H_
-#define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_GTK_H_
-#pragma once
-
-#include <gtk/gtk.h>
-
-#include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h"
-#include "ui/views/controls/native/native_view_host.h"
-
-class NativeTabContentsContainerGtk : public NativeTabContentsContainer,
- public views::NativeViewHost {
- public:
- explicit NativeTabContentsContainerGtk(TabContentsContainer* container);
- virtual ~NativeTabContentsContainerGtk();
-
- // Overridden from NativeTabContentsContainer:
- virtual void AttachContents(content::WebContents* contents) OVERRIDE;
- virtual void DetachContents(content::WebContents* contents) OVERRIDE;
- virtual void SetFastResize(bool fast_resize) OVERRIDE;
- virtual bool GetFastResize() const OVERRIDE;
- virtual bool FastResizeAtLastLayout() const OVERRIDE;
- virtual void RenderViewHostChanged(
- content::RenderViewHost* old_host,
- content::RenderViewHost* new_host) OVERRIDE;
- virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE;
- virtual views::View* GetView() OVERRIDE;
-
- // Overridden from views::View:
- virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) OVERRIDE;
- virtual views::FocusTraversable* GetFocusTraversable() OVERRIDE;
- virtual bool IsFocusable() const OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void RequestFocus() OVERRIDE;
- virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
- virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
-
- private:
- TabContentsContainer* container_;
-
- gulong focus_callback_id_;
-
- DISALLOW_COPY_AND_ASSIGN(NativeTabContentsContainerGtk);
-};
-
-#endif // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_GTK_H_
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index b62a994..67f2c4d 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -3843,8 +3843,6 @@
'browser/ui/views/tab_contents/native_tab_contents_container.h',
'browser/ui/views/tab_contents/native_tab_contents_container_aura.cc',
'browser/ui/views/tab_contents/native_tab_contents_container_aura.h',
- 'browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc',
- 'browser/ui/views/tab_contents/native_tab_contents_container_gtk.h',
'browser/ui/views/tab_contents/native_tab_contents_container_win.cc',
'browser/ui/views/tab_contents/native_tab_contents_container_win.h',
'browser/ui/views/tab_contents/native_tab_contents_view.h',
@@ -5280,8 +5278,6 @@
['include', '^browser/ui/views/status_icons/status_tray_linux.cc'],
['include', '^browser/ui/views/tab_contents/native_tab_contents_container_aura.cc'],
['include', '^browser/ui/views/tab_contents/native_tab_contents_container_aura.h'],
- ['include', '^browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc'],
- ['include', '^browser/ui/views/tab_contents/native_tab_contents_container_gtk.h'],
['include', '^browser/ui/views/tab_contents/native_tab_contents_view_aura.cc'],
['include', '^browser/ui/views/tab_contents/native_tab_contents_view_aura.h'],
['include', '^browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc'],