| 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/extensions/extension_tabs_module.h" | 5 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 new ExtensionMsg_ExecuteCode(render_view_host->routing_id(), | 1077 new ExtensionMsg_ExecuteCode(render_view_host->routing_id(), |
| 1078 params)); | 1078 params)); |
| 1079 | 1079 |
| 1080 Observe(contents->tab_contents()); | 1080 Observe(contents->tab_contents()); |
| 1081 AddRef(); // balanced in Observe() | 1081 AddRef(); // balanced in Observe() |
| 1082 | 1082 |
| 1083 return true; | 1083 return true; |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 controller.LoadURL( | 1086 controller.LoadURL( |
| 1087 url, GURL(), content::PAGE_TRANSITION_LINK, std::string()); | 1087 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); |
| 1088 | 1088 |
| 1089 // The URL of a tab contents never actually changes to a JavaScript URL, so | 1089 // The URL of a tab contents never actually changes to a JavaScript URL, so |
| 1090 // this check only makes sense in other cases. | 1090 // this check only makes sense in other cases. |
| 1091 if (!url.SchemeIs(chrome::kJavaScriptScheme)) | 1091 if (!url.SchemeIs(chrome::kJavaScriptScheme)) |
| 1092 DCHECK_EQ(url.spec(), contents->tab_contents()->GetURL().spec()); | 1092 DCHECK_EQ(url.spec(), contents->tab_contents()->GetURL().spec()); |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 bool active = false; | 1095 bool active = false; |
| 1096 // TODO(rafaelw): Setting |active| from js doesn't make much sense. | 1096 // TODO(rafaelw): Setting |active| from js doesn't make much sense. |
| 1097 // Move tab selection management up to window. | 1097 // Move tab selection management up to window. |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 // called for every API call the extension made. | 1615 // called for every API call the extension made. |
| 1616 GotLanguage(language); | 1616 GotLanguage(language); |
| 1617 } | 1617 } |
| 1618 | 1618 |
| 1619 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1619 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
| 1620 result_.reset(Value::CreateStringValue(language.c_str())); | 1620 result_.reset(Value::CreateStringValue(language.c_str())); |
| 1621 SendResponse(true); | 1621 SendResponse(true); |
| 1622 | 1622 |
| 1623 Release(); // Balanced in Run() | 1623 Release(); // Balanced in Run() |
| 1624 } | 1624 } |
| OLD | NEW |