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

Side by Side 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, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h"
6
7 #include "content/public/browser/browser_context.h"
8 #include "content/public/browser/web_contents.h"
9
10 using content::OpenURLParams;
11 using content::WebContents;
12 using content::BrowserContext;
13
14 namespace web_dialogs {
15 // Incognito profiles are not long-lived, so we always want to store a
16 // non-incognito profile.
17 //
18 // TODO(akalin): Should we make it so that we have a default incognito
19 // profile that's long-lived? Of course, we'd still have to clear it out
20 // when all incognito browsers close.
21 WebDialogWebContentsDelegate::WebDialogWebContentsDelegate
22 (BrowserContext* context)
23 : context_(context) {
24 }
25
26 WebDialogWebContentsDelegate::~WebDialogWebContentsDelegate() {
27 }
28
29 BrowserContext* WebDialogWebContentsDelegate::context() const {
30 return context_;
31 }
32
33 void WebDialogWebContentsDelegate::Detach() {
34 context_ = NULL;
35 }
36
37 bool WebDialogWebContentsDelegate::IsPopupOrPanel(
38 const WebContents* source) const {
39 // This needs to return true so that we are allowed to be resized by our
40 // contents.
41 return true;
42 }
43
44 bool WebDialogWebContentsDelegate::ShouldAddNavigationToHistory(
45 const history::HistoryAddPageArgs& add_page_args,
46 content::NavigationType navigation_type) {
47 return false;
48 }
49 } // namespace web_dialogs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698