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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab( | 31 TabContents* HtmlDialogTabContentsDelegate::OpenURLFromTab( |
32 TabContents* source, const OpenURLParams& params) { | 32 TabContents* source, const OpenURLParams& params) { |
33 if (profile_) { | 33 if (profile_) { |
34 // Specify a NULL browser for navigation. This will cause Navigate() | 34 // Specify a NULL browser for navigation. This will cause Navigate() |
35 // to find a browser matching params.profile or create a new one. | 35 // to find a browser matching params.profile or create a new one. |
36 Browser* browser = NULL; | 36 Browser* browser = NULL; |
37 browser::NavigateParams nav_params(browser, params.url, params.transition); | 37 browser::NavigateParams nav_params(browser, params.url, params.transition); |
38 nav_params.profile = profile_; | 38 nav_params.profile = profile_; |
39 nav_params.referrer = params.referrer; | 39 nav_params.referrer = params.referrer; |
40 if (source && source->is_crashed() && | 40 if (source && source->IsCrashed() && |
41 params.disposition == CURRENT_TAB && | 41 params.disposition == CURRENT_TAB && |
42 params.transition == content::PAGE_TRANSITION_LINK) | 42 params.transition == content::PAGE_TRANSITION_LINK) |
43 nav_params.disposition = NEW_FOREGROUND_TAB; | 43 nav_params.disposition = NEW_FOREGROUND_TAB; |
44 else | 44 else |
45 nav_params.disposition = params.disposition; | 45 nav_params.disposition = params.disposition; |
46 nav_params.window_action = browser::NavigateParams::SHOW_WINDOW; | 46 nav_params.window_action = browser::NavigateParams::SHOW_WINDOW; |
47 nav_params.user_gesture = true; | 47 nav_params.user_gesture = true; |
48 browser::Navigate(&nav_params); | 48 browser::Navigate(&nav_params); |
49 return nav_params.target_contents ? | 49 return nav_params.target_contents ? |
50 nav_params.target_contents->tab_contents() : NULL; | 50 nav_params.target_contents->tab_contents() : NULL; |
(...skipping 28 matching lines...) Expand all Loading... |
79 // This needs to return true so that we are allowed to be resized by our | 79 // This needs to return true so that we are allowed to be resized by our |
80 // contents. | 80 // contents. |
81 return true; | 81 return true; |
82 } | 82 } |
83 | 83 |
84 bool HtmlDialogTabContentsDelegate::ShouldAddNavigationToHistory( | 84 bool HtmlDialogTabContentsDelegate::ShouldAddNavigationToHistory( |
85 const history::HistoryAddPageArgs& add_page_args, | 85 const history::HistoryAddPageArgs& add_page_args, |
86 content::NavigationType navigation_type) { | 86 content::NavigationType navigation_type) { |
87 return false; | 87 return false; |
88 } | 88 } |
OLD | NEW |