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_save_page_api.h" | 5 #include "chrome/browser/extensions/extension_save_page_api.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 error_ = error; | 117 error_ = error; |
118 | 118 |
119 SendResponse(false); | 119 SendResponse(false); |
120 | 120 |
121 Release(); // Balanced in Run() | 121 Release(); // Balanced in Run() |
122 } | 122 } |
123 | 123 |
124 void SavePageAsMHTMLFunction::ReturnSuccess(int64 file_size) { | 124 void SavePageAsMHTMLFunction::ReturnSuccess(int64 file_size) { |
125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
126 | 126 |
127 int child_id = render_view_host()->process()->id(); | 127 int child_id = render_view_host()->process()->GetID(); |
128 ChildProcessSecurityPolicy::GetInstance()->GrantReadFile( | 128 ChildProcessSecurityPolicy::GetInstance()->GrantReadFile( |
129 child_id, mhtml_path_); | 129 child_id, mhtml_path_); |
130 | 130 |
131 DictionaryValue* dict = new DictionaryValue(); | 131 DictionaryValue* dict = new DictionaryValue(); |
132 result_.reset(dict); | 132 result_.reset(dict); |
133 dict->SetString("mhtmlFilePath", mhtml_path_.value()); | 133 dict->SetString("mhtmlFilePath", mhtml_path_.value()); |
134 dict->SetInteger("mhtmlFileLength", file_size); | 134 dict->SetInteger("mhtmlFileLength", file_size); |
135 | 135 |
136 SendResponse(true); | 136 SendResponse(true); |
137 | 137 |
138 Release(); // Balanced in Run() | 138 Release(); // Balanced in Run() |
139 } | 139 } |
OLD | NEW |