| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" | 5 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 void HtmlDialogTabContentsDelegate::Detach() { | 27 void HtmlDialogTabContentsDelegate::Detach() { |
| 28 profile_ = NULL; | 28 profile_ = NULL; |
| 29 } | 29 } |
| 30 | 30 |
| 31 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 31 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
| 32 TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab( | 32 TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab( |
| 33 TabContents* source, const GURL& url, const GURL& referrer, | 33 TabContents* source, const GURL& url, const GURL& referrer, |
| 34 WindowOpenDisposition disposition, content::PageTransition transition) { | 34 WindowOpenDisposition disposition, content::PageTransition transition) { |
| 35 return OpenURLFromTab(source, | 35 return OpenURLFromTab(source, |
| 36 OpenURLParams(url, referrer, disposition, transition)); | 36 OpenURLParams(url, referrer, disposition, transition, |
| 37 false)); |
| 37 } | 38 } |
| 38 | 39 |
| 39 TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab( | 40 TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab( |
| 40 TabContents* source, const OpenURLParams& params) { | 41 TabContents* source, const OpenURLParams& params) { |
| 41 if (profile_) { | 42 if (profile_) { |
| 42 // Specify a NULL browser for navigation. This will cause Navigate() | 43 // Specify a NULL browser for navigation. This will cause Navigate() |
| 43 // to find a browser matching params.profile or create a new one. | 44 // to find a browser matching params.profile or create a new one. |
| 44 Browser* browser = NULL; | 45 Browser* browser = NULL; |
| 45 browser::NavigateParams nav_params(browser, params.url, params.transition); | 46 browser::NavigateParams nav_params(browser, params.url, params.transition); |
| 46 nav_params.profile = profile_; | 47 nav_params.profile = profile_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // This needs to return true so that we are allowed to be resized by our | 87 // This needs to return true so that we are allowed to be resized by our |
| 87 // contents. | 88 // contents. |
| 88 return true; | 89 return true; |
| 89 } | 90 } |
| 90 | 91 |
| 91 bool HtmlDialogTabContentsDelegate::ShouldAddNavigationToHistory( | 92 bool HtmlDialogTabContentsDelegate::ShouldAddNavigationToHistory( |
| 92 const history::HistoryAddPageArgs& add_page_args, | 93 const history::HistoryAddPageArgs& add_page_args, |
| 93 NavigationType::Type navigation_type) { | 94 NavigationType::Type navigation_type) { |
| 94 return false; | 95 return false; |
| 95 } | 96 } |
| OLD | NEW |