| 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/ui/tab_contents/core_tab_helper.h" | 5 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 base::Unretained(this), | 115 base::Unretained(this), |
| 116 src_url)); | 116 src_url)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CoreTabHelper::RequestThumbnailForContextNode( | 119 void CoreTabHelper::RequestThumbnailForContextNode( |
| 120 content::RenderFrameHost* render_frame_host, | 120 content::RenderFrameHost* render_frame_host, |
| 121 int minimum_size, | 121 int minimum_size, |
| 122 gfx::Size maximum_size, | 122 gfx::Size maximum_size, |
| 123 const ContextNodeThumbnailCallback& callback) { | 123 const ContextNodeThumbnailCallback& callback) { |
| 124 int callback_id = thumbnail_callbacks_.Add( | 124 int callback_id = thumbnail_callbacks_.Add( |
| 125 new ContextNodeThumbnailCallback(callback)); | 125 base::MakeUnique<ContextNodeThumbnailCallback>(callback)); |
| 126 | 126 |
| 127 render_frame_host->Send( | 127 render_frame_host->Send( |
| 128 new ChromeViewMsg_RequestThumbnailForContextNode( | 128 new ChromeViewMsg_RequestThumbnailForContextNode( |
| 129 render_frame_host->GetRoutingID(), | 129 render_frame_host->GetRoutingID(), |
| 130 minimum_size, | 130 minimum_size, |
| 131 maximum_size, | 131 maximum_size, |
| 132 callback_id)); | 132 callback_id)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 // static | 135 // static |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 DCHECK(!content_type.empty()); | 392 DCHECK(!content_type.empty()); |
| 393 open_url_params.uses_post = true; | 393 open_url_params.uses_post = true; |
| 394 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes( | 394 open_url_params.post_data = content::ResourceRequestBody::CreateFromBytes( |
| 395 post_data.data(), post_data.size()); | 395 post_data.data(), post_data.size()); |
| 396 open_url_params.extra_headers += base::StringPrintf( | 396 open_url_params.extra_headers += base::StringPrintf( |
| 397 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, | 397 "%s: %s\r\n", net::HttpRequestHeaders::kContentType, |
| 398 content_type.c_str()); | 398 content_type.c_str()); |
| 399 } | 399 } |
| 400 web_contents()->OpenURL(open_url_params); | 400 web_contents()->OpenURL(open_url_params); |
| 401 } | 401 } |
| OLD | NEW |