| Index: ui/web_dialogs/web_dialog_web_contents_delegate.cc
|
| ===================================================================
|
| --- ui/web_dialogs/web_dialog_web_contents_delegate.cc (revision 0)
|
| +++ ui/web_dialogs/web_dialog_web_contents_delegate.cc (revision 0)
|
| @@ -0,0 +1,49 @@
|
| +// 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.
|
| +
|
| +#include "ui/web_dialogs/web_dialog_web_contents_delegate.h"
|
| +
|
| +#include "content/public/browser/web_contents.h"
|
| +#include "content/public/browser/browser_context.h"
|
| +
|
| +using content::OpenURLParams;
|
| +using content::WebContents;
|
| +using content::BrowserContext;
|
| +
|
| +namespace views {
|
| +// Incognito profiles are not long-lived, so we always want to store a
|
| +// non-incognito profile.
|
| +//
|
| +// TODO(akalin): Should we make it so that we have a default incognito
|
| +// profile that's long-lived? Of course, we'd still have to clear it out
|
| +// when all incognito browsers close.
|
| +WebDialogWebContentsDelegate::WebDialogWebContentsDelegate
|
| +(BrowserContext* context)
|
| + : context_(context) {
|
| +}
|
| +
|
| +WebDialogWebContentsDelegate::~WebDialogWebContentsDelegate() {
|
| +}
|
| +
|
| +BrowserContext* WebDialogWebContentsDelegate::context() const {
|
| + return context_;
|
| +}
|
| +
|
| +void WebDialogWebContentsDelegate::Detach() {
|
| + context_ = NULL;
|
| +}
|
| +
|
| +bool WebDialogWebContentsDelegate::IsPopupOrPanel(
|
| + const WebContents* source) const {
|
| + // This needs to return true so that we are allowed to be resized by our
|
| + // contents.
|
| + return true;
|
| +}
|
| +
|
| +bool WebDialogWebContentsDelegate::ShouldAddNavigationToHistory(
|
| + const history::HistoryAddPageArgs& add_page_args,
|
| + content::NavigationType navigation_type) {
|
| + return false;
|
| +}
|
| +} //namespace views
|
|
|