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

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: fix nacl64 build 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 3850 matching lines...) Expand 10 before | Expand all | Expand 10 after
3905 webkit_glue::ImageDecoder decoder(gfx::Size(kFavIconSize, kFavIconSize)); 3906 webkit_glue::ImageDecoder decoder(gfx::Size(kFavIconSize, kFavIconSize));
3906 const unsigned char* src_data = 3907 const unsigned char* src_data =
3907 reinterpret_cast<const unsigned char*>(&data[0]); 3908 reinterpret_cast<const unsigned char*>(&data[0]);
3908 3909
3909 return decoder.Decode(src_data, data.size()); 3910 return decoder.Decode(src_data, data.size());
3910 } 3911 }
3911 return SkBitmap(); 3912 return SkBitmap();
3912 } 3913 }
3913 3914
3914 void RenderView::OnGetApplicationInfo(int page_id) { 3915 void RenderView::OnGetApplicationInfo(int page_id) {
3915 webkit_glue::WebApplicationInfo app_info; 3916 WebApplicationInfo app_info;
3916 if (page_id == page_id_) 3917 if (page_id == page_id_) {
3917 webkit_glue::GetApplicationInfo(webview(), &app_info); 3918 string16 error;
3919 ParseWebAppFromWebDocument(webview()->mainFrame(), &app_info, &error);
3920 }
3918 3921
3919 // Prune out any data URLs in the set of icons. The browser process expects 3922 // Prune out any data URLs in the set of icons. The browser process expects
3920 // any icon with a data URL to have originated from a favicon. We don't want 3923 // any icon with a data URL to have originated from a favicon. We don't want
3921 // to decode arbitrary data URLs in the browser process. See 3924 // to decode arbitrary data URLs in the browser process. See
3922 // http://b/issue?id=1162972 3925 // http://b/issue?id=1162972
3923 for (size_t i = 0; i < app_info.icons.size(); ++i) { 3926 for (size_t i = 0; i < app_info.icons.size(); ++i) {
3924 if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) { 3927 if (app_info.icons[i].url.SchemeIs(chrome::kDataScheme)) {
3925 app_info.icons.erase(app_info.icons.begin() + i); 3928 app_info.icons.erase(app_info.icons.begin() + i);
3926 --i; 3929 --i;
3927 } 3930 }
(...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after
5488 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), 5491 IPC::PlatformFileForTransitToPlatformFile(file_for_transit),
5489 message_id); 5492 message_id);
5490 } 5493 }
5491 5494
5492 #if defined(OS_MACOSX) 5495 #if defined(OS_MACOSX)
5493 void RenderView::OnSelectPopupMenuItem(int selected_index) { 5496 void RenderView::OnSelectPopupMenuItem(int selected_index) {
5494 external_popup_menu_->DidSelectItem(selected_index); 5497 external_popup_menu_->DidSelectItem(selected_index);
5495 external_popup_menu_.reset(); 5498 external_popup_menu_.reset();
5496 } 5499 }
5497 #endif 5500 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698