Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: chrome/browser/extensions/api/page_capture/page_capture_api.cc

Issue 16915006: Convert most of extensions and some other random stuff to using the base namespace for Values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/file_util.h" 10 #include "base/file_util.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 WebContents* web_contents = GetWebContents(); 168 WebContents* web_contents = GetWebContents();
169 if (!web_contents || !render_view_host()) { 169 if (!web_contents || !render_view_host()) {
170 ReturnFailure(kTabClosedError); 170 ReturnFailure(kTabClosedError);
171 return; 171 return;
172 } 172 }
173 173
174 int child_id = render_view_host()->GetProcess()->GetID(); 174 int child_id = render_view_host()->GetProcess()->GetID();
175 ChildProcessSecurityPolicy::GetInstance()->GrantReadFile( 175 ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(
176 child_id, mhtml_path_); 176 child_id, mhtml_path_);
177 177
178 DictionaryValue* dict = new DictionaryValue(); 178 base::DictionaryValue* dict = new base::DictionaryValue();
179 SetResult(dict); 179 SetResult(dict);
180 dict->SetString("mhtmlFilePath", mhtml_path_.value()); 180 dict->SetString("mhtmlFilePath", mhtml_path_.value());
181 dict->SetInteger("mhtmlFileLength", file_size); 181 dict->SetInteger("mhtmlFileLength", file_size);
182 182
183 SendResponse(true); 183 SendResponse(true);
184 184
185 // Note that we'll wait for a response ack message received in 185 // Note that we'll wait for a response ack message received in
186 // OnMessageReceivedFromRenderView before we call Release() (to prevent the 186 // OnMessageReceivedFromRenderView before we call Release() (to prevent the
187 // blob file from being deleted). 187 // blob file from being deleted).
188 } 188 }
189 189
190 WebContents* PageCaptureSaveAsMHTMLFunction::GetWebContents() { 190 WebContents* PageCaptureSaveAsMHTMLFunction::GetWebContents() {
191 Browser* browser = NULL; 191 Browser* browser = NULL;
192 content::WebContents* web_contents = NULL; 192 content::WebContents* web_contents = NULL;
193 193
194 if (!ExtensionTabUtil::GetTabById(params_->details.tab_id, profile(), 194 if (!ExtensionTabUtil::GetTabById(params_->details.tab_id, profile(),
195 include_incognito(), &browser, NULL, 195 include_incognito(), &browser, NULL,
196 &web_contents, NULL)) { 196 &web_contents, NULL)) {
197 return NULL; 197 return NULL;
198 } 198 }
199 return web_contents; 199 return web_contents;
200 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698