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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 4979003: Implement web app definition parsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 10 years, 1 month 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 24 matching lines...) Expand all
35 #include "chrome/common/file_system/file_system_dispatcher.h" 35 #include "chrome/common/file_system/file_system_dispatcher.h"
36 #include "chrome/common/file_system/webfilesystem_callback_dispatcher.h" 36 #include "chrome/common/file_system/webfilesystem_callback_dispatcher.h"
37 #include "chrome/common/jstemplate_builder.h" 37 #include "chrome/common/jstemplate_builder.h"
38 #include "chrome/common/notification_service.h" 38 #include "chrome/common/notification_service.h"
39 #include "chrome/common/page_zoom.h" 39 #include "chrome/common/page_zoom.h"
40 #include "chrome/common/pepper_plugin_registry.h" 40 #include "chrome/common/pepper_plugin_registry.h"
41 #include "chrome/common/render_messages.h" 41 #include "chrome/common/render_messages.h"
42 #include "chrome/common/renderer_preferences.h" 42 #include "chrome/common/renderer_preferences.h"
43 #include "chrome/common/thumbnail_score.h" 43 #include "chrome/common/thumbnail_score.h"
44 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
45 #include "chrome/common/web_apps.h"
45 #include "chrome/common/window_container_type.h" 46 #include "chrome/common/window_container_type.h"
46 #include "chrome/renderer/about_handler.h" 47 #include "chrome/renderer/about_handler.h"
47 #include "chrome/renderer/audio_message_filter.h" 48 #include "chrome/renderer/audio_message_filter.h"
48 #include "chrome/renderer/autofill_helper.h" 49 #include "chrome/renderer/autofill_helper.h"
49 #include "chrome/renderer/automation/dom_automation_controller.h" 50 #include "chrome/renderer/automation/dom_automation_controller.h"
50 #include "chrome/renderer/blocked_plugin.h" 51 #include "chrome/renderer/blocked_plugin.h"
51 #include "chrome/renderer/device_orientation_dispatcher.h" 52 #include "chrome/renderer/device_orientation_dispatcher.h"
52 #include "chrome/renderer/devtools_agent.h" 53 #include "chrome/renderer/devtools_agent.h"
53 #include "chrome/renderer/devtools_client.h" 54 #include "chrome/renderer/devtools_client.h"
54 #include "chrome/renderer/dom_ui_bindings.h" 55 #include "chrome/renderer/dom_ui_bindings.h"
(...skipping 3849 matching lines...) Expand 10 before | Expand all | Expand 10 after
3904 webkit_glue::ImageDecoder decoder(gfx::Size(kFavIconSize, kFavIconSize)); 3905 webkit_glue::ImageDecoder decoder(gfx::Size(kFavIconSize, kFavIconSize));
3905 const unsigned char* src_data = 3906 const unsigned char* src_data =
3906 reinterpret_cast<const unsigned char*>(&data[0]); 3907 reinterpret_cast<const unsigned char*>(&data[0]);
3907 3908
3908 return decoder.Decode(src_data, data.size()); 3909 return decoder.Decode(src_data, data.size());
3909 } 3910 }
3910 return SkBitmap(); 3911 return SkBitmap();
3911 } 3912 }
3912 3913
3913 void RenderView::OnGetApplicationInfo(int page_id) { 3914 void RenderView::OnGetApplicationInfo(int page_id) {
3914 webkit_glue::WebApplicationInfo app_info; 3915 WebApplicationInfo app_info;
3915 if (page_id == page_id_) 3916 if (page_id == page_id_) {
3916 webkit_glue::GetApplicationInfo(webview(), &app_info); 3917 string16 error;
3918 ParseWebAppFromWebDocument(webview()->mainFrame(), &app_info, &error);
Erik does not do reviews 2010/11/15 19:45:36 Since this can fail, don't we need to punt if it r
Aaron Boodman 2010/11/16 03:44:45 No, the calling code in the browser process just d
Erik does not do reviews 2010/11/16 23:43:02 ok
3919 }
3917 3920
3918 // Prune out any data URLs in the set of icons. The browser process expects 3921 // Prune out any data URLs in the set of icons. The browser process expects
3919 // any icon with a data URL to have originated from a favicon. We don't want 3922 // any icon with a data URL to have originated from a favicon. We don't want
3920 // to decode arbitrary data URLs in the browser process. See 3923 // to decode arbitrary data URLs in the browser process. See
3921 // http://b/issue?id=1162972 3924 // http://b/issue?id=1162972
3922 for (size_t i = 0; i < app_info.icons.size(); ++i) { 3925 for (size_t i = 0; i < app_info.icons.size(); ++i) {
3923 if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) { 3926 if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) {
3924 app_info.icons.erase(app_info.icons.begin() + i); 3927 app_info.icons.erase(app_info.icons.begin() + i);
3925 --i; 3928 --i;
3926 } 3929 }
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after
5487 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), 5490 IPC::PlatformFileForTransitToPlatformFile(file_for_transit),
5488 message_id); 5491 message_id);
5489 } 5492 }
5490 5493
5491 #if defined(OS_MACOSX) 5494 #if defined(OS_MACOSX)
5492 void RenderView::OnSelectPopupMenuItem(int selected_index) { 5495 void RenderView::OnSelectPopupMenuItem(int selected_index) {
5493 external_popup_menu_->DidSelectItem(selected_index); 5496 external_popup_menu_->DidSelectItem(selected_index);
5494 external_popup_menu_.reset(); 5497 external_popup_menu_.reset();
5495 } 5498 }
5496 #endif 5499 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698