Add code to register <webview> tag

This commit is contained in:
Cheng Zhao 2014-10-22 22:55:13 +08:00
parent e7c7e086b1
commit 380de24f2e
10 changed files with 649 additions and 1 deletions

View 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

View 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_

View 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

View 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_