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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { | 1336 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { |
1337 CHECK_EQ(tab, web_contents_); | 1337 CHECK_EQ(tab, web_contents_); |
1338 web_contents_ = NULL; | 1338 web_contents_ = NULL; |
1339 } | 1339 } |
1340 | 1340 |
1341 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { | 1341 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { |
1342 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) | 1342 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) |
1343 return false; | 1343 return false; |
1344 | 1344 |
1345 int message_request_id = -1; | 1345 int message_request_id = -1; |
1346 void* iter = NULL; | 1346 PickleReader iter(message); |
1347 if (!message.ReadInt(&iter, &message_request_id)) { | 1347 if (!message.ReadInt(&iter, &message_request_id)) { |
1348 NOTREACHED() << "malformed extension message"; | 1348 NOTREACHED() << "malformed extension message"; |
1349 return true; | 1349 return true; |
1350 } | 1350 } |
1351 | 1351 |
1352 if (message_request_id != request_id()) | 1352 if (message_request_id != request_id()) |
1353 return false; | 1353 return false; |
1354 | 1354 |
1355 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) | 1355 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) |
1356 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, | 1356 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1793 // called for every API call the extension made. | 1793 // called for every API call the extension made. |
1794 GotLanguage(language); | 1794 GotLanguage(language); |
1795 } | 1795 } |
1796 | 1796 |
1797 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1797 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1798 result_.reset(Value::CreateStringValue(language.c_str())); | 1798 result_.reset(Value::CreateStringValue(language.c_str())); |
1799 SendResponse(true); | 1799 SendResponse(true); |
1800 | 1800 |
1801 Release(); // Balanced in Run() | 1801 Release(); // Balanced in Run() |
1802 } | 1802 } |
OLD | NEW |