Home | History | Annotate | Download | only in tab_contents
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_GTK_H_
      6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_GTK_H_
      7 #pragma once
      8 
      9 #include <gtk/gtk.h>
     10 
     11 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h"
     12 #include "views/controls/native/native_view_host.h"
     13 
     14 class NativeTabContentsContainerGtk : public NativeTabContentsContainer,
     15                                       public views::NativeViewHost {
     16  public:
     17   explicit NativeTabContentsContainerGtk(TabContentsContainer* container);
     18   virtual ~NativeTabContentsContainerGtk();
     19 
     20   // Overridden from NativeTabContentsContainer:
     21   virtual void AttachContents(TabContents* contents) OVERRIDE;
     22   virtual void DetachContents(TabContents* contents) OVERRIDE;
     23   virtual void SetFastResize(bool fast_resize) OVERRIDE;
     24   virtual void RenderViewHostChanged(RenderViewHost* old_host,
     25                                      RenderViewHost* new_host) OVERRIDE;
     26   virtual void TabContentsFocused(TabContents* tab_contents) OVERRIDE;
     27   virtual views::View* GetView() OVERRIDE;
     28 
     29   // Overridden from views::View:
     30   virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e) OVERRIDE;
     31   virtual views::FocusTraversable* GetFocusTraversable() OVERRIDE;
     32   virtual bool IsFocusable() const OVERRIDE;
     33   virtual void OnFocus() OVERRIDE;
     34   virtual void RequestFocus() OVERRIDE;
     35   virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
     36   virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
     37 
     38  private:
     39   TabContentsContainer* container_;
     40 
     41   gulong focus_callback_id_;
     42 
     43   DISALLOW_COPY_AND_ASSIGN(NativeTabContentsContainerGtk);
     44 };
     45 
     46 #endif  // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_GTK_H_
     47