| OLD | NEW |
| (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/web_contents.h" |
| 8 #include "content/public/browser/browser_context.h" |
| 9 |
| 10 using content::OpenURLParams; |
| 11 using content::WebContents; |
| 12 using content::BrowserContext; |
| 13 |
| 14 namespace views { |
| 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 views |
| OLD | NEW |