OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/singleton_tabs.h" | 5 #include "chrome/browser/ui/singleton_tabs.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_navigator.h" | 9 #include "chrome/browser/ui/browser_navigator.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 int tab_count = params->browser->tab_strip_model()->count(); | 90 int tab_count = params->browser->tab_strip_model()->count(); |
91 for (int i = 0; i < tab_count; ++i) { | 91 for (int i = 0; i < tab_count; ++i) { |
92 int tab_index = (start_index + i) % tab_count; | 92 int tab_index = (start_index + i) % tab_count; |
93 content::WebContents* tab = | 93 content::WebContents* tab = |
94 params->browser->tab_strip_model()->GetWebContentsAt(tab_index); | 94 params->browser->tab_strip_model()->GetWebContentsAt(tab_index); |
95 | 95 |
96 GURL tab_url = tab->GetURL(); | 96 GURL tab_url = tab->GetURL(); |
97 | 97 |
98 // Skip view-source tabs. This is needed because RewriteURLIfNecessary | 98 // Skip view-source tabs. This is needed because RewriteURLIfNecessary |
99 // removes the "view-source:" scheme which leads to incorrect matching. | 99 // removes the "view-source:" scheme which leads to incorrect matching. |
100 if (tab_url.SchemeIs(chrome::kViewSourceScheme)) | 100 if (tab_url.SchemeIs(content::kViewSourceScheme)) |
101 continue; | 101 continue; |
102 | 102 |
103 GURL rewritten_tab_url = tab_url; | 103 GURL rewritten_tab_url = tab_url; |
104 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 104 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
105 &rewritten_tab_url, | 105 &rewritten_tab_url, |
106 params->browser->profile(), | 106 params->browser->profile(), |
107 &reverse_on_redirect); | 107 &reverse_on_redirect); |
108 | 108 |
109 url_canon::Replacements<char> replacements; | 109 url_canon::Replacements<char> replacements; |
110 if (params->ref_behavior == NavigateParams::IGNORE_REF) | 110 if (params->ref_behavior == NavigateParams::IGNORE_REF) |
(...skipping 10 matching lines...) Expand all Loading... |
121 replacements)) { | 121 replacements)) { |
122 params->target_contents = tab; | 122 params->target_contents = tab; |
123 return tab_index; | 123 return tab_index; |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 return -1; | 127 return -1; |
128 } | 128 } |
129 | 129 |
130 } // namespace chrome | 130 } // namespace chrome |
OLD | NEW |