Add code to register <webview> tag
This commit is contained in:
parent
e7c7e086b1
commit
380de24f2e
10 changed files with 649 additions and 1 deletions
11
atom/browser/web_view/web_view_guest.cc
Normal file
11
atom/browser/web_view/web_view_guest.cc
Normal file
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/web_view/web_view_guest.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
||||
|
||||
} // namespace atom
|
19
atom/browser/web_view/web_view_guest.h
Normal file
19
atom/browser/web_view/web_view_guest.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_WEB_VIEW_WEB_VIEW_GUEST_H_
|
||||
#define ATOM_BROWSER_WEB_VIEW_WEB_VIEW_GUEST_H_
|
||||
|
||||
namespace atom {
|
||||
|
||||
// A WebViewGuest provides the browser-side implementation of the <webview> API
|
||||
// and manages the dispatch of <webview> extension events. WebViewGuest is
|
||||
// created on attachment. That is, when a guest WebContents is associated with
|
||||
// a particular embedder WebContents. This happens on either initial navigation
|
||||
// or through the use of the New Window API, when a new window is attached to
|
||||
// a particular <webview>.
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_WEB_VIEW_WEB_VIEW_GUEST_H_
|
31
atom/browser/web_view/web_view_manager.cc
Normal file
31
atom/browser/web_view/web_view_manager.cc
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/web_view/web_view_manager.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
WebViewManager::WebViewManager(content::BrowserContext* context) {
|
||||
}
|
||||
|
||||
WebViewManager::~WebViewManager() {
|
||||
}
|
||||
|
||||
void WebViewManager::MaybeGetGuestByInstanceIDOrKill(
|
||||
int guest_instance_id,
|
||||
int embedder_render_process_id,
|
||||
const GuestByInstanceIDCallback& callback) {
|
||||
LOG(ERROR) << "MaybeGetGuestByInstanceIDOrKill";
|
||||
callback.Run(nullptr);
|
||||
}
|
||||
|
||||
bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,
|
||||
const GuestCallback& callback) {
|
||||
LOG(ERROR) << "ForEachGuest";
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace atom
|
35
atom/browser/web_view/web_view_manager.h
Normal file
35
atom/browser/web_view/web_view_manager.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_WEB_VIEW_WEB_VIEW_MANAGER_H_
|
||||
#define ATOM_BROWSER_WEB_VIEW_WEB_VIEW_MANAGER_H_
|
||||
|
||||
#include "content/public/browser/browser_plugin_guest_manager.h"
|
||||
|
||||
namespace content {
|
||||
class BrowserContext;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
|
||||
class WebViewManager : public content::BrowserPluginGuestManager {
|
||||
public:
|
||||
explicit WebViewManager(content::BrowserContext* context);
|
||||
virtual ~WebViewManager();
|
||||
|
||||
// content::BrowserPluginGuestManager:
|
||||
virtual void MaybeGetGuestByInstanceIDOrKill(
|
||||
int guest_instance_id,
|
||||
int embedder_render_process_id,
|
||||
const GuestByInstanceIDCallback& callback) override;
|
||||
virtual bool ForEachGuest(content::WebContents* embedder_web_contents,
|
||||
const GuestCallback& callback) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(WebViewManager);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_WEB_VIEW_WEB_VIEW_MANAGER_H_
|
Loading…
Add table
Add a link
Reference in a new issue