Home | History | Annotate | Download | only in tab_contents
      1 // Copyright (c) 2009 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_H_
      6 #define CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_H_
      7 #pragma once
      8 
      9 class RenderViewHost;
     10 class TabContents;
     11 class TabContentsContainer;
     12 namespace views {
     13 class View;
     14 }
     15 
     16 // An interface that the TabContentsContainer uses to talk to a platform-
     17 // specific view that hosts the native handle of the TabContents' view.
     18 class NativeTabContentsContainer {
     19  public:
     20   // Creates an appropriate native container for the current platform.
     21   static NativeTabContentsContainer* CreateNativeContainer(
     22       TabContentsContainer* container);
     23 
     24   // Attaches the new TabContents to the native container.
     25   virtual void AttachContents(TabContents* contents) = 0;
     26 
     27   // Detaches the old TabContents from the native container.
     28   virtual void DetachContents(TabContents* contents) = 0;
     29 
     30   // Tells the container to update less frequently during resizing operations
     31   // so performance is better.
     32   virtual void SetFastResize(bool fast_resize) = 0;
     33 
     34   // Tells the container that the RenderViewHost for the attached TabContents
     35   // has changed and it should update focus.
     36   virtual void RenderViewHostChanged(RenderViewHost* old_host,
     37                                      RenderViewHost* new_host) = 0;
     38 
     39   // Tells the container that |tab_contents| got the focus.
     40   virtual void TabContentsFocused(TabContents* tab_contents) = 0;
     41 
     42   // Retrieves the views::View that hosts the TabContents.
     43   virtual views::View* GetView() = 0;
     44  protected:
     45   virtual ~NativeTabContentsContainer() {}
     46 };
     47 
     48 #endif  // CHROME_BROWSER_UI_VIEWS_TAB_CONTENTS_NATIVE_TAB_CONTENTS_CONTAINER_H_
     49