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_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_
6 #define CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_
8 #include "base/values.h"
9 #include "chrome/browser/guest_view/guest_view.h"
11 // An AdViewGuest provides the browser-side implementation of the <adview> API
12 // and manages the dispatch of <adview> extension events. AdViewGuest is created
13 // on attachment. When a guest WebContents is associated with a particular
14 // embedder WebContents, we call this "attachment".
15 // TODO(fsamuel): There might be an opportunity here to refactor and reuse code
16 // between AdViewGuest and WebViewGuest.
17 class AdViewGuest
: public GuestView
<AdViewGuest
> {
19 AdViewGuest(int guest_instance_id
,
20 content::WebContents
* guest_web_contents
,
21 const std::string
& extension_id
);
23 static const char Type
[];
26 virtual ~AdViewGuest();
28 virtual void DidCommitProvisionalLoadForFrame(
30 const base::string16
& frame_unique_name
,
33 content::PageTransition transition_type
,
34 content::RenderViewHost
* render_view_host
) OVERRIDE
;
35 virtual void DidFailProvisionalLoad(
37 const base::string16
& frame_unique_name
,
39 const GURL
& validated_url
,
41 const base::string16
& error_description
,
42 content::RenderViewHost
* render_view_host
) OVERRIDE
;
44 DISALLOW_COPY_AND_ASSIGN(AdViewGuest
);
47 #endif // CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_