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 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1352 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { | 1352 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { |
1353 CHECK_EQ(tab, web_contents_); | 1353 CHECK_EQ(tab, web_contents_); |
1354 web_contents_ = NULL; | 1354 web_contents_ = NULL; |
1355 } | 1355 } |
1356 | 1356 |
1357 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { | 1357 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { |
1358 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) | 1358 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) |
1359 return false; | 1359 return false; |
1360 | 1360 |
1361 int message_request_id = -1; | 1361 int message_request_id = -1; |
1362 void* iter = NULL; | 1362 PickleIterator iter(message); |
1363 if (!message.ReadInt(&iter, &message_request_id)) { | 1363 if (!message.ReadInt(&iter, &message_request_id)) { |
1364 NOTREACHED() << "malformed extension message"; | 1364 NOTREACHED() << "malformed extension message"; |
1365 return true; | 1365 return true; |
1366 } | 1366 } |
1367 | 1367 |
1368 if (message_request_id != request_id()) | 1368 if (message_request_id != request_id()) |
1369 return false; | 1369 return false; |
1370 | 1370 |
1371 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) | 1371 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) |
1372 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, | 1372 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 // called for every API call the extension made. | 1809 // called for every API call the extension made. |
1810 GotLanguage(language); | 1810 GotLanguage(language); |
1811 } | 1811 } |
1812 | 1812 |
1813 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1813 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1814 result_.reset(Value::CreateStringValue(language.c_str())); | 1814 result_.reset(Value::CreateStringValue(language.c_str())); |
1815 SendResponse(true); | 1815 SendResponse(true); |
1816 | 1816 |
1817 Release(); // Balanced in Run() | 1817 Release(); // Balanced in Run() |
1818 } | 1818 } |
OLD | NEW |