OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/chrome_extension_helper.h" | 5 #include "chrome/renderer/extensions/chrome_extension_helper.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "chrome/common/extensions/chrome_extension_messages.h" | 8 #include "chrome/common/extensions/chrome_extension_messages.h" |
9 #include "chrome/renderer/web_apps.h" | 9 #include "chrome/renderer/web_apps.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 base::string16 error; | 40 base::string16 error; |
41 web_apps::ParseWebAppFromWebDocument( | 41 web_apps::ParseWebAppFromWebDocument( |
42 render_view()->GetWebView()->mainFrame(), &app_info, &error); | 42 render_view()->GetWebView()->mainFrame(), &app_info, &error); |
43 } | 43 } |
44 | 44 |
45 // Prune out any data URLs in the set of icons. The browser process expects | 45 // Prune out any data URLs in the set of icons. The browser process expects |
46 // any icon with a data URL to have originated from a favicon. We don't want | 46 // any icon with a data URL to have originated from a favicon. We don't want |
47 // to decode arbitrary data URLs in the browser process. See | 47 // to decode arbitrary data URLs in the browser process. See |
48 // http://b/issue?id=1162972 | 48 // http://b/issue?id=1162972 |
49 for (size_t i = 0; i < app_info.icons.size(); ++i) { | 49 for (size_t i = 0; i < app_info.icons.size(); ++i) { |
50 if (app_info.icons[i].url.SchemeIs(content::kDataScheme)) { | 50 if (app_info.icons[i].url.SchemeIs(url::kDataScheme)) { |
51 app_info.icons.erase(app_info.icons.begin() + i); | 51 app_info.icons.erase(app_info.icons.begin() + i); |
52 --i; | 52 --i; |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 Send(new ChromeExtensionHostMsg_DidGetApplicationInfo( | 56 Send(new ChromeExtensionHostMsg_DidGetApplicationInfo( |
57 routing_id(), page_id, app_info)); | 57 routing_id(), page_id, app_info)); |
58 } | 58 } |
59 | 59 |
60 } // namespace extensions | 60 } // namespace extensions |
OLD | NEW |