| Index: content/browser/browser_plugin/browser_plugin_web_contents_observer.h
|
| diff --git a/content/browser/browser_plugin/browser_plugin_web_contents_observer.h b/content/browser/browser_plugin/browser_plugin_web_contents_observer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f6b32d933128399adbf8103b9774dc7a73b44e14
|
| --- /dev/null
|
| +++ b/content/browser/browser_plugin/browser_plugin_web_contents_observer.h
|
| @@ -0,0 +1,63 @@
|
| +// Copyright (c) 2012 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 CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_WEB_CONTENTS_OBSERVER_H__
|
| +#define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_WEB_CONTENTS_OBSERVER_H__
|
| +#pragma once
|
| +
|
| +#include "base/hash_tables.h"
|
| +#include "content/browser/browser_plugin/renderer_host/browser_plugin_message_filter.h"
|
| +#include "content/public/browser/notification_registrar.h"
|
| +#include "content/public/browser/notification_observer.h"
|
| +#include "content/public/browser/web_contents_observer.h"
|
| +
|
| +class BrowserPluginWebContentsObserver: public content::WebContentsObserver,
|
| + public content::NotificationObserver {
|
| + public:
|
| + typedef base::hash_set<content::WebContents*,
|
| + hash_web_contents> GuestSet;
|
| + typedef base::hash_map<content::WebContents*,
|
| + int64,
|
| + hash_web_contents> GuestMap;
|
| +
|
| + virtual ~BrowserPluginWebContentsObserver();
|
| +
|
| + static BrowserPluginWebContentsObserver* Create(
|
| + content::WebContents* web_contents);
|
| +
|
| + void AddGuest(content::WebContents* guest, int64 frame_id);
|
| +
|
| + void RemoveGuest(content::WebContents* guest);
|
| +
|
| + virtual void DidCommitProvisionalLoadForFrame(
|
| + int64 frame_id,
|
| + bool is_main_frame,
|
| + const GURL& url,
|
| + content::PageTransition transition_type) OVERRIDE;
|
| +
|
| + virtual void RenderViewDeleted(
|
| + content::RenderViewHost* render_view_host) OVERRIDE;
|
| +
|
| + virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
|
| +
|
| + virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
|
| +
|
| + private:
|
| + BrowserPluginWebContentsObserver(
|
| + content::WebContents* web_contents);
|
| +
|
| + void DestroyGuests();
|
| +
|
| + // content::NotificationObserver method override.
|
| + virtual void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) OVERRIDE;
|
| +
|
| + // A scoped container for notification registries.
|
| + content::NotificationRegistrar registrar_;
|
| +
|
| + GuestMap guests_;
|
| +};
|
| +
|
| +#endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_WEB_CONTENTS_OBSERVER_H_
|
|
|