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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 browser::NavigateParams params(browser, extension_url, | 762 browser::NavigateParams params(browser, extension_url, |
763 content::PAGE_TRANSITION_START_PAGE); | 763 content::PAGE_TRANSITION_START_PAGE); |
764 params.tabstrip_add_types = add_type; | 764 params.tabstrip_add_types = add_type; |
765 params.disposition = disposition; | 765 params.disposition = disposition; |
766 | 766 |
767 if (disposition == CURRENT_TAB) { | 767 if (disposition == CURRENT_TAB) { |
768 TabContents* existing_tab = browser->GetSelectedTabContents(); | 768 TabContents* existing_tab = browser->GetSelectedTabContents(); |
769 TabStripModel* model = browser->tabstrip_model(); | 769 TabStripModel* model = browser->tabstrip_model(); |
770 int tab_index = model->GetWrapperIndex(existing_tab); | 770 int tab_index = model->GetWrapperIndex(existing_tab); |
771 | 771 |
772 existing_tab->OpenURL(extension_url, existing_tab->GetURL(), | 772 existing_tab->OpenURL(OpenURLParams(extension_url, existing_tab->GetURL(), |
773 disposition, content::PAGE_TRANSITION_LINK); | 773 disposition, content::PAGE_TRANSITION_LINK, false)); |
774 if (params.tabstrip_add_types & TabStripModel::ADD_PINNED) { | 774 if (params.tabstrip_add_types & TabStripModel::ADD_PINNED) { |
775 model->SetTabPinned(tab_index, true); | 775 model->SetTabPinned(tab_index, true); |
776 tab_index = model->GetWrapperIndex(existing_tab); | 776 tab_index = model->GetWrapperIndex(existing_tab); |
777 } | 777 } |
778 if (params.tabstrip_add_types & TabStripModel::ADD_ACTIVE) | 778 if (params.tabstrip_add_types & TabStripModel::ADD_ACTIVE) |
779 model->ActivateTabAt(tab_index, true); | 779 model->ActivateTabAt(tab_index, true); |
780 | 780 |
781 contents = existing_tab; | 781 contents = existing_tab; |
782 } else { | 782 } else { |
783 browser::Navigate(¶ms); | 783 browser::Navigate(¶ms); |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 } | 2960 } |
2961 | 2961 |
2962 /////////////////////////////////////////////////////////////////////////////// | 2962 /////////////////////////////////////////////////////////////////////////////// |
2963 // Browser, PageNavigator implementation: | 2963 // Browser, PageNavigator implementation: |
2964 | 2964 |
2965 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 2965 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
2966 TabContents* Browser::OpenURL(const GURL& url, | 2966 TabContents* Browser::OpenURL(const GURL& url, |
2967 const GURL& referrer, | 2967 const GURL& referrer, |
2968 WindowOpenDisposition disposition, | 2968 WindowOpenDisposition disposition, |
2969 content::PageTransition transition) { | 2969 content::PageTransition transition) { |
| 2970 // For specifying a referrer, use the version of OpenURL taking OpenURLParams. |
| 2971 DCHECK(referrer.is_empty()); |
2970 return OpenURLFromTab(NULL, | 2972 return OpenURLFromTab(NULL, |
2971 OpenURLParams(url, referrer, disposition, transition, | 2973 OpenURLParams(url, referrer, disposition, transition, |
2972 false)); | 2974 false)); |
2973 } | 2975 } |
2974 | 2976 |
2975 TabContents* Browser::OpenURL(const OpenURLParams& params) { | 2977 TabContents* Browser::OpenURL(const OpenURLParams& params) { |
2976 return OpenURLFromTab(NULL, params); | 2978 return OpenURLFromTab(NULL, params); |
2977 } | 2979 } |
2978 | 2980 |
2979 /////////////////////////////////////////////////////////////////////////////// | 2981 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5326 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5328 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5327 } else { | 5329 } else { |
5328 GlobalErrorService* service = | 5330 GlobalErrorService* service = |
5329 GlobalErrorServiceFactory::GetForProfile(profile()); | 5331 GlobalErrorServiceFactory::GetForProfile(profile()); |
5330 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5332 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5331 if (error) { | 5333 if (error) { |
5332 error->ShowBubbleView(this); | 5334 error->ShowBubbleView(this); |
5333 } | 5335 } |
5334 } | 5336 } |
5335 } | 5337 } |
OLD | NEW |