This source file includes following definitions.
- handler_
- Detach
- OpenURLFromTab
- AddNewContents
- IsPopupOrPanel
- PreHandleGestureEvent
#include "ui/web_dialogs/web_dialog_web_contents_delegate.h"
#include "base/logging.h"
#include "content/public/browser/web_contents.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
using content::BrowserContext;
using content::OpenURLParams;
using content::WebContents;
namespace ui {
WebDialogWebContentsDelegate::WebDialogWebContentsDelegate(
content::BrowserContext* browser_context,
WebContentsHandler* handler)
: browser_context_(browser_context),
handler_(handler) {
CHECK(handler_.get());
}
WebDialogWebContentsDelegate::~WebDialogWebContentsDelegate() {
}
void WebDialogWebContentsDelegate::Detach() {
browser_context_ = NULL;
}
WebContents* WebDialogWebContentsDelegate::OpenURLFromTab(
WebContents* source, const OpenURLParams& params) {
return handler_->OpenURLFromTab(browser_context_, source, params);
}
void WebDialogWebContentsDelegate::AddNewContents(
WebContents* source, WebContents* new_contents,
WindowOpenDisposition disposition, const gfx::Rect& initial_pos,
bool user_gesture,
bool* was_blocked) {
handler_->AddNewContents(browser_context_, source, new_contents, disposition,
initial_pos, user_gesture);
}
bool WebDialogWebContentsDelegate::IsPopupOrPanel(
const WebContents* source) const {
return true;
}
bool WebDialogWebContentsDelegate::PreHandleGestureEvent(
WebContents* source,
const blink::WebGestureEvent& event) {
return event.type == blink::WebGestureEvent::GesturePinchBegin ||
event.type == blink::WebGestureEvent::GesturePinchUpdate ||
event.type == blink::WebGestureEvent::GesturePinchEnd;
}
}