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/api/page_capture/page_capture_api.h" | 5 #include "chrome/browser/extensions/api/page_capture/page_capture_api.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 base::Bind(&PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile, this)); | 66 base::Bind(&PageCaptureSaveAsMHTMLFunction::CreateTemporaryFile, this)); |
67 return true; | 67 return true; |
68 } | 68 } |
69 | 69 |
70 bool PageCaptureSaveAsMHTMLFunction::OnMessageReceived( | 70 bool PageCaptureSaveAsMHTMLFunction::OnMessageReceived( |
71 const IPC::Message& message) { | 71 const IPC::Message& message) { |
72 if (message.type() != ExtensionHostMsg_ResponseAck::ID) | 72 if (message.type() != ExtensionHostMsg_ResponseAck::ID) |
73 return false; | 73 return false; |
74 | 74 |
75 int message_request_id; | 75 int message_request_id; |
76 PickleIterator iter(message); | 76 base::PickleIterator iter(message); |
77 if (!iter.ReadInt(&message_request_id)) { | 77 if (!iter.ReadInt(&message_request_id)) { |
78 NOTREACHED() << "malformed extension message"; | 78 NOTREACHED() << "malformed extension message"; |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
82 if (message_request_id != request_id()) | 82 if (message_request_id != request_id()) |
83 return false; | 83 return false; |
84 | 84 |
85 // The extension process has processed the response and has created a | 85 // The extension process has processed the response and has created a |
86 // reference to the blob, it is safe for us to go away. | 86 // reference to the blob, it is safe for us to go away. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 GetProfile(), | 194 GetProfile(), |
195 include_incognito(), | 195 include_incognito(), |
196 &browser, | 196 &browser, |
197 NULL, | 197 NULL, |
198 &web_contents, | 198 &web_contents, |
199 NULL)) { | 199 NULL)) { |
200 return NULL; | 200 return NULL; |
201 } | 201 } |
202 return web_contents; | 202 return web_contents; |
203 } | 203 } |
OLD | NEW |