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/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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { | 1275 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { |
1276 CHECK_EQ(tab, web_contents_); | 1276 CHECK_EQ(tab, web_contents_); |
1277 web_contents_ = NULL; | 1277 web_contents_ = NULL; |
1278 } | 1278 } |
1279 | 1279 |
1280 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { | 1280 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { |
1281 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) | 1281 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) |
1282 return false; | 1282 return false; |
1283 | 1283 |
1284 int message_request_id = -1; | 1284 int message_request_id = -1; |
1285 void* iter = NULL; | 1285 PickleReader iter(message); |
1286 if (!message.ReadInt(&iter, &message_request_id)) { | 1286 if (!message.ReadInt(&iter, &message_request_id)) { |
1287 NOTREACHED() << "malformed extension message"; | 1287 NOTREACHED() << "malformed extension message"; |
1288 return true; | 1288 return true; |
1289 } | 1289 } |
1290 | 1290 |
1291 if (message_request_id != request_id()) | 1291 if (message_request_id != request_id()) |
1292 return false; | 1292 return false; |
1293 | 1293 |
1294 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) | 1294 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) |
1295 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, | 1295 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 // called for every API call the extension made. | 1745 // called for every API call the extension made. |
1746 GotLanguage(language); | 1746 GotLanguage(language); |
1747 } | 1747 } |
1748 | 1748 |
1749 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1749 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1750 result_.reset(Value::CreateStringValue(language.c_str())); | 1750 result_.reset(Value::CreateStringValue(language.c_str())); |
1751 SendResponse(true); | 1751 SendResponse(true); |
1752 | 1752 |
1753 Release(); // Balanced in Run() | 1753 Release(); // Balanced in Run() |
1754 } | 1754 } |
OLD | NEW |