[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / frame / contents_web_view.h
blob5d023637e14a406b083164e822e0a84bb15c0157
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_WEB_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_WEB_VIEW_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/views/frame/web_contents_close_handler_delegate.h"
12 #include "ui/compositor/layer_owner_delegate.h"
13 #include "ui/views/controls/webview/webview.h"
15 class StatusBubbleViews;
17 namespace ui {
18 class LayerTreeOwner;
21 // ContentsWebView is used to present the WebContents of the active tab.
22 class ContentsWebView
23 : public views::WebView,
24 public ui::LayerOwnerDelegate,
25 public WebContentsCloseHandlerDelegate {
26 public:
27 explicit ContentsWebView(content::BrowserContext* browser_context);
28 virtual ~ContentsWebView();
30 // Sets the status bubble, which should be repositioned every time
31 // this view changes visible bounds.
32 void SetStatusBubble(StatusBubbleViews* status_bubble);
34 // WebView overrides:
35 virtual bool NeedsNotificationWhenVisibleBoundsChange() const OVERRIDE;
36 virtual void OnVisibleBoundsChanged() OVERRIDE;
37 virtual void ViewHierarchyChanged(const ViewHierarchyChangedDetails& details)
38 OVERRIDE;
39 virtual void OnThemeChanged() OVERRIDE;
41 // ui::LayerOwnerDelegate overrides:
42 virtual void OnLayerRecreated(ui::Layer* old_layer,
43 ui::Layer* new_layer) OVERRIDE;
45 // WebContentsCloseHandlerDelegate overrides:
46 virtual void CloneWebContentsLayer() OVERRIDE;
47 virtual void DestroyClonedLayer() OVERRIDE;
49 private:
50 StatusBubbleViews* status_bubble_;
52 scoped_ptr<ui::LayerTreeOwner> cloned_layer_tree_;
54 DISALLOW_COPY_AND_ASSIGN(ContentsWebView);
57 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_WEB_VIEW_H_