Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: chrome/browser/guestview/adview/adview_guest.h

Issue 257823005: [Sheriff] Revert "Revert "Revert 266297 "1. Handle the case of empty embedder_extension_id...""" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_ 5 #ifndef CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_GUEST_H_
6 #define CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_ 6 #define CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_GUEST_H_
7 7
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/guest_view/guest_view.h" 9 #include "chrome/browser/guestview/guestview.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
11 11
12 // An AdViewGuest is a WebContentsObserver on the guest WebContents of a 12 // An AdViewGuest is a WebContentsObserver on the guest WebContents of a
13 // <adview> tag. It provides the browser-side implementation of the <adview> 13 // <adview> tag. It provides the browser-side implementation of the <adview>
14 // API and manages the lifetime of <adview> extension events. AdViewGuest is 14 // API and manages the lifetime of <adview> extension events. AdViewGuest is
15 // created on attachment. When a guest WebContents is associated with 15 // created on attachment. When a guest WebContents is associated with
16 // a particular embedder WebContents, we call this "attachment". 16 // a particular embedder WebContents, we call this "attachment".
17 // TODO(fsamuel): There might be an opportunity here to refactor and reuse code 17 // TODO(fsamuel): There might be an opportunity here to refactor and reuse code
18 // between AdViewGuest and WebViewGuest. 18 // between AdViewGuest and WebViewGuest.
19 class AdViewGuest : public GuestView<AdViewGuest>, 19 class AdViewGuest : public GuestView,
20 public content::WebContentsObserver { 20 public content::WebContentsObserver {
21 public: 21 public:
22 AdViewGuest(content::WebContents* guest_web_contents, 22 AdViewGuest(content::WebContents* guest_web_contents,
23 const std::string& extension_id); 23 const std::string& extension_id);
24 24
25 static const char Type[]; 25 static AdViewGuest* From(int embedder_process_id, int instance_id);
26
27 // GuestView implementation.
28 virtual GuestView::Type GetViewType() const OVERRIDE;
29 virtual WebViewGuest* AsWebView() OVERRIDE;
30 virtual AdViewGuest* AsAdView() OVERRIDE;
26 31
27 private: 32 private:
28 virtual ~AdViewGuest(); 33 virtual ~AdViewGuest();
29 34
30 virtual void DidCommitProvisionalLoadForFrame( 35 virtual void DidCommitProvisionalLoadForFrame(
31 int64 frame_id, 36 int64 frame_id,
32 const base::string16& frame_unique_name, 37 const base::string16& frame_unique_name,
33 bool is_main_frame, 38 bool is_main_frame,
34 const GURL& url, 39 const GURL& url,
35 content::PageTransition transition_type, 40 content::PageTransition transition_type,
36 content::RenderViewHost* render_view_host) OVERRIDE; 41 content::RenderViewHost* render_view_host) OVERRIDE;
37 virtual void DidFailProvisionalLoad( 42 virtual void DidFailProvisionalLoad(
38 int64 frame_id, 43 int64 frame_id,
39 const base::string16& frame_unique_name, 44 const base::string16& frame_unique_name,
40 bool is_main_frame, 45 bool is_main_frame,
41 const GURL& validated_url, 46 const GURL& validated_url,
42 int error_code, 47 int error_code,
43 const base::string16& error_description, 48 const base::string16& error_description,
44 content::RenderViewHost* render_view_host) OVERRIDE; 49 content::RenderViewHost* render_view_host) OVERRIDE;
45 50
46 DISALLOW_COPY_AND_ASSIGN(AdViewGuest); 51 DISALLOW_COPY_AND_ASSIGN(AdViewGuest);
47 }; 52 };
48 53
49 #endif // CHROME_BROWSER_GUEST_VIEW_AD_VIEW_AD_VIEW_GUEST_H_ 54 #endif // CHROME_BROWSER_GUESTVIEW_ADVIEW_ADVIEW_GUEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/guestview/adview/adview_constants.cc ('k') | chrome/browser/guestview/adview/adview_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698