Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: ui/web_dialogs/web_dialog_web_contents_delegate.cc

Issue 10353007: Extract a minimal subset of WebDialogUI/WebDialogDelegate from src/chrome -> src/ui/web_dialogs Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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/browser_context.h"
+#include "content/public/browser/web_contents.h"
+
+using content::OpenURLParams;
+using content::WebContents;
+using content::BrowserContext;
+
+namespace web_dialogs {
+// 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 web_dialogs

Powered by Google App Engine
This is Rietveld 408576698