| 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 4024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4035 !DownloadImage(id, image_url, image_size)) { | 4035 !DownloadImage(id, image_url, image_size)) { |
| 4036 Send(new ViewHostMsg_DidDownloadFavIcon(routing_id_, id, image_url, true, | 4036 Send(new ViewHostMsg_DidDownloadFavIcon(routing_id_, id, image_url, true, |
| 4037 SkBitmap())); | 4037 SkBitmap())); |
| 4038 } | 4038 } |
| 4039 } | 4039 } |
| 4040 | 4040 |
| 4041 SkBitmap RenderView::ImageFromDataUrl(const GURL& url) const { | 4041 SkBitmap RenderView::ImageFromDataUrl(const GURL& url) const { |
| 4042 std::string mime_type, char_set, data; | 4042 std::string mime_type, char_set, data; |
| 4043 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && !data.empty()) { | 4043 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && !data.empty()) { |
| 4044 // Decode the favicon using WebKit's image decoder. | 4044 // Decode the favicon using WebKit's image decoder. |
| 4045 webkit_glue::ImageDecoder decoder(gfx::Size(kFavIconSize, kFavIconSize)); | 4045 webkit_glue::ImageDecoder decoder(gfx::Size(kFaviconSize, kFaviconSize)); |
| 4046 const unsigned char* src_data = | 4046 const unsigned char* src_data = |
| 4047 reinterpret_cast<const unsigned char*>(&data[0]); | 4047 reinterpret_cast<const unsigned char*>(&data[0]); |
| 4048 | 4048 |
| 4049 return decoder.Decode(src_data, data.size()); | 4049 return decoder.Decode(src_data, data.size()); |
| 4050 } | 4050 } |
| 4051 return SkBitmap(); | 4051 return SkBitmap(); |
| 4052 } | 4052 } |
| 4053 | 4053 |
| 4054 void RenderView::OnGetApplicationInfo(int page_id) { | 4054 void RenderView::OnGetApplicationInfo(int page_id) { |
| 4055 WebApplicationInfo app_info; | 4055 WebApplicationInfo app_info; |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5605 const webkit_glue::CustomContextMenuContext& custom_context) { | 5605 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 5606 if (custom_context.is_pepper_menu) | 5606 if (custom_context.is_pepper_menu) |
| 5607 pepper_delegate_.OnContextMenuClosed(custom_context); | 5607 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 5608 else | 5608 else |
| 5609 context_menu_node_.reset(); | 5609 context_menu_node_.reset(); |
| 5610 } | 5610 } |
| 5611 | 5611 |
| 5612 void RenderView::OnNetworkStateChanged(bool online) { | 5612 void RenderView::OnNetworkStateChanged(bool online) { |
| 5613 WebNetworkStateNotifier::setOnLine(online); | 5613 WebNetworkStateNotifier::setOnLine(online); |
| 5614 } | 5614 } |
| OLD | NEW |