| 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/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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 | 1053 |
| 1054 int Browser::active_index() const { | 1054 int Browser::active_index() const { |
| 1055 return tab_strip_model_->active_index(); | 1055 return tab_strip_model_->active_index(); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 int Browser::GetIndexOfController( | 1058 int Browser::GetIndexOfController( |
| 1059 const NavigationController* controller) const { | 1059 const NavigationController* controller) const { |
| 1060 return tab_strip_model_->GetIndexOfController(controller); | 1060 return tab_strip_model_->GetIndexOfController(controller); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 // DEPRECATED | |
| 1064 TabContents* Browser::GetSelectedTabContentsWrapper() const { | |
| 1065 return GetActiveTabContents(); | |
| 1066 } | |
| 1067 | |
| 1068 TabContents* Browser::GetActiveTabContents() const { | 1063 TabContents* Browser::GetActiveTabContents() const { |
| 1069 return tab_strip_model_->GetActiveTabContents(); | 1064 return tab_strip_model_->GetActiveTabContents(); |
| 1070 } | 1065 } |
| 1071 | 1066 |
| 1072 // DEPRECATED | 1067 // DEPRECATED |
| 1073 WebContents* Browser::GetSelectedWebContents() const { | 1068 WebContents* Browser::GetSelectedWebContents() const { |
| 1074 return GetActiveWebContents(); | 1069 return GetActiveWebContents(); |
| 1075 } | 1070 } |
| 1076 | 1071 |
| 1077 WebContents* Browser::GetActiveWebContents() const { | 1072 WebContents* Browser::GetActiveWebContents() const { |
| 1078 TabContents* tab_contents = GetActiveTabContents(); | 1073 TabContents* tab_contents = GetActiveTabContents(); |
| 1079 return tab_contents ? tab_contents->web_contents() : NULL; | 1074 return tab_contents ? tab_contents->web_contents() : NULL; |
| 1080 } | 1075 } |
| 1081 | 1076 |
| 1082 // DEPRECATED | |
| 1083 TabContents* Browser::GetTabContentsWrapperAt(int index) const { | |
| 1084 return GetTabContentsAt(index); | |
| 1085 } | |
| 1086 | |
| 1087 TabContents* Browser::GetTabContentsAt(int index) const { | 1077 TabContents* Browser::GetTabContentsAt(int index) const { |
| 1088 return tab_strip_model_->GetTabContentsAt(index); | 1078 return tab_strip_model_->GetTabContentsAt(index); |
| 1089 } | 1079 } |
| 1090 | 1080 |
| 1091 WebContents* Browser::GetWebContentsAt(int index) const { | 1081 WebContents* Browser::GetWebContentsAt(int index) const { |
| 1092 TabContents* tab_contents = GetTabContentsAt(index); | 1082 TabContents* tab_contents = GetTabContentsAt(index); |
| 1093 if (tab_contents) | 1083 if (tab_contents) |
| 1094 return tab_contents->web_contents(); | 1084 return tab_contents->web_contents(); |
| 1095 return NULL; | 1085 return NULL; |
| 1096 } | 1086 } |
| (...skipping 4091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5188 if (contents && !allow_js_access) { | 5178 if (contents && !allow_js_access) { |
| 5189 contents->web_contents()->GetController().LoadURL( | 5179 contents->web_contents()->GetController().LoadURL( |
| 5190 target_url, | 5180 target_url, |
| 5191 content::Referrer(), | 5181 content::Referrer(), |
| 5192 content::PAGE_TRANSITION_LINK, | 5182 content::PAGE_TRANSITION_LINK, |
| 5193 std::string()); // No extra headers. | 5183 std::string()); // No extra headers. |
| 5194 } | 5184 } |
| 5195 | 5185 |
| 5196 return contents != NULL; | 5186 return contents != NULL; |
| 5197 } | 5187 } |
| OLD | NEW |