summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/extension_view_gtk.h
blob: 7612c94091978272aa45483148ec5ec7cdf6b90d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2009 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_GTK_EXTENSION_VIEW_GTK_H_
#define CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_

#include "base/basictypes.h"
#include "base/gfx/native_widget_types.h"

class Browser;
class ExtensionHost;
class RenderViewHost;
class RenderWidgetHostViewGtk;
class SkBitmap;

class ExtensionViewGtk {
 public:
  ExtensionViewGtk(ExtensionHost* extension_host, Browser* browser);

  void Init();

  gfx::NativeView native_view();
  Browser* browser() const { return browser_; }

  bool is_toolstrip() const { return is_toolstrip_; }
  void set_is_toolstrip(bool is_toolstrip) { is_toolstrip_ = is_toolstrip; }

  void SetBackground(const SkBitmap& background);

  // Method for the ExtensionHost to notify us about the correct width for
  // extension contents.
  void UpdatePreferredWidth(int pref_width);

 private:
  RenderViewHost* render_view_host() const;

  void CreateWidgetHostView();

  // True if the contents are being displayed inside the extension shelf.
  bool is_toolstrip_;

  Browser* browser_;

  ExtensionHost* extension_host_;

  RenderWidgetHostViewGtk* render_widget_host_view_;

  DISALLOW_COPY_AND_ASSIGN(ExtensionViewGtk);
};

#endif  // CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_