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

Side by Side Diff: chrome/common/render_messages.h

Issue 46055: RSS feed support (part 1), 2nd attempt (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months 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
« no previous file with comments | « chrome/browser/views/location_bar_view.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_
6 #define CHROME_COMMON_RENDER_MESSAGES_H_ 6 #define CHROME_COMMON_RENDER_MESSAGES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <map> 10 #include <map>
(...skipping 10 matching lines...) Expand all
21 #include "chrome/common/page_transition_types.h" 21 #include "chrome/common/page_transition_types.h"
22 #include "chrome/common/transport_dib.h" 22 #include "chrome/common/transport_dib.h"
23 #include "googleurl/src/gurl.h" 23 #include "googleurl/src/gurl.h"
24 #include "media/audio/audio_output.h" 24 #include "media/audio/audio_output.h"
25 #include "net/base/upload_data.h" 25 #include "net/base/upload_data.h"
26 #include "net/http/http_response_headers.h" 26 #include "net/http/http_response_headers.h"
27 #include "net/url_request/url_request_status.h" 27 #include "net/url_request/url_request_status.h"
28 #include "webkit/glue/autofill_form.h" 28 #include "webkit/glue/autofill_form.h"
29 #include "webkit/glue/cache_manager.h" 29 #include "webkit/glue/cache_manager.h"
30 #include "webkit/glue/context_menu.h" 30 #include "webkit/glue/context_menu.h"
31 #include "webkit/glue/feed.h"
31 #include "webkit/glue/form_data.h" 32 #include "webkit/glue/form_data.h"
32 #include "webkit/glue/password_form.h" 33 #include "webkit/glue/password_form.h"
33 #include "webkit/glue/password_form_dom_manager.h" 34 #include "webkit/glue/password_form_dom_manager.h"
34 #include "webkit/glue/resource_loader_bridge.h" 35 #include "webkit/glue/resource_loader_bridge.h"
35 #include "webkit/glue/screen_info.h" 36 #include "webkit/glue/screen_info.h"
36 #include "webkit/glue/webdropdata.h" 37 #include "webkit/glue/webdropdata.h"
37 #include "webkit/glue/webinputevent.h" 38 #include "webkit/glue/webinputevent.h"
38 #include "webkit/glue/webplugin.h" 39 #include "webkit/glue/webplugin.h"
39 #include "webkit/glue/webpreferences.h" 40 #include "webkit/glue/webpreferences.h"
40 #include "webkit/glue/webview_delegate.h" 41 #include "webkit/glue/webview_delegate.h"
41 42
42 #if defined(OS_POSIX) 43 #if defined(OS_POSIX)
43 #include "skia/include/SkBitmap.h" 44 #include "skia/include/SkBitmap.h"
44 #endif 45 #endif
45 46
47 struct ViewHostMsg_UpdateFeedList_Params {
48 // The page_id for this navigation, or -1 if it is a new navigation. Back,
49 // Forward, and Reload navigations should have a valid page_id. If the load
50 // succeeds, then this page_id will be reflected in the resulting
51 // ViewHostMsg_FrameNavigate message.
52 int32 page_id;
53
54 // The list of available feeds.
55 scoped_refptr<FeedList> feedlist;
56 };
57
46 // Parameters structure for ViewMsg_Navigate, which has too many data 58 // Parameters structure for ViewMsg_Navigate, which has too many data
47 // parameters to be reasonably put in a predefined IPC message. 59 // parameters to be reasonably put in a predefined IPC message.
48 struct ViewMsg_Navigate_Params { 60 struct ViewMsg_Navigate_Params {
49 // The page_id for this navigation, or -1 if it is a new navigation. Back, 61 // The page_id for this navigation, or -1 if it is a new navigation. Back,
50 // Forward, and Reload navigations should have a valid page_id. If the load 62 // Forward, and Reload navigations should have a valid page_id. If the load
51 // succeeds, then this page_id will be reflected in the resultant 63 // succeeds, then this page_id will be reflected in the resultant
52 // ViewHostMsg_FrameNavigate message. 64 // ViewHostMsg_FrameNavigate message.
53 int32 page_id; 65 int32 page_id;
54 66
55 // The URL to load. 67 // The URL to load.
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 break; 518 break;
507 default: 519 default:
508 type = L"UNKNOWN"; 520 type = L"UNKNOWN";
509 break; 521 break;
510 } 522 }
511 523
512 LogParam(type, l); 524 LogParam(type, l);
513 } 525 }
514 }; 526 };
515 527
528 // Traits for ViewHostMsg_UpdateFeedList_Params structure to pack/unpack.
529 template <>
530 struct ParamTraits<ViewHostMsg_UpdateFeedList_Params> {
531 typedef ViewHostMsg_UpdateFeedList_Params param_type;
532 static void Write(Message* msg, const param_type& param) {
533 WriteParam(msg, param.page_id);
534 WriteParam(msg, param.feedlist->list().size());
535 for (std::vector<FeedItem>::const_iterator iter =
536 param.feedlist->list().begin();
537 iter != param.feedlist->list().end(); iter++) {
538 WriteParam(msg, iter->title);
539 WriteParam(msg, iter->type);
540 WriteParam(msg, iter->url);
541 }
542 }
543 static bool Read(const Message* msg, void** iter, param_type* param) {
544 param->feedlist = new FeedList();
545 if (!ReadParam(msg, iter, &param->page_id))
546 return false;
547
548 size_t arraysize = 0;
549 if (!ReadParam(msg, iter, &arraysize))
550 return false;
551
552 if (arraysize > FeedList::kMaxFeeds) {
553 NOTREACHED() << L"Too many feeds sent by the renderer";
554 return false;
555 }
556
557 bool ret = true;
558 for (size_t i = 0; i < arraysize; i++) {
559 FeedItem feeditem;
560 ret = ReadParam(msg, iter, &feeditem.title) &&
561 ReadParam(msg, iter, &feeditem.type) &&
562 ReadParam(msg, iter, &feeditem.url);
563 if (!ret)
564 return ret;
565 param->feedlist->Add(feeditem);
566 }
567
568 return ret;
569 }
570 static void Log(const param_type& param, std::wstring* log) {
571 log->append(L"(");
572 LogParam(param.page_id, log);
573 log->append(L", {");
574 for (std::vector<FeedItem>::const_iterator iter =
575 param.feedlist->list().begin();
576 iter != param.feedlist->list().end(); iter++) {
577 log->append(L"[");
578 LogParam(iter->title, log);
579 log->append(L", ");
580 LogParam(iter->type, log);
581 log->append(L", ");
582 LogParam(iter->url, log);
583 log->append(L"]");
584 }
585 log->append(L"})");
586 }
587 };
588
516 template <> 589 template <>
517 struct ParamTraits<AccessibilityInParams> { 590 struct ParamTraits<AccessibilityInParams> {
518 typedef AccessibilityInParams param_type; 591 typedef AccessibilityInParams param_type;
519 static void Write(Message* m, const param_type& p) { 592 static void Write(Message* m, const param_type& p) {
520 WriteParam(m, p.iaccessible_id); 593 WriteParam(m, p.iaccessible_id);
521 WriteParam(m, p.iaccessible_function_id); 594 WriteParam(m, p.iaccessible_function_id);
522 WriteParam(m, p.input_variant_lval); 595 WriteParam(m, p.input_variant_lval);
523 WriteParam(m, p.input_long1); 596 WriteParam(m, p.input_long1);
524 WriteParam(m, p.input_long2); 597 WriteParam(m, p.input_long2);
525 } 598 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 WriteParam(m, itr->name); 787 WriteParam(m, itr->name);
715 WriteParam(m, itr->value); 788 WriteParam(m, itr->value);
716 } 789 }
717 } 790 }
718 static bool Read(const Message* m, void** iter, param_type* p) { 791 static bool Read(const Message* m, void** iter, param_type* p) {
719 bool result = true; 792 bool result = true;
720 size_t elements_size = 0; 793 size_t elements_size = 0;
721 result = result && ReadParam(m, iter, &elements_size); 794 result = result && ReadParam(m, iter, &elements_size);
722 p->elements.resize(elements_size); 795 p->elements.resize(elements_size);
723 for (size_t i = 0; i < elements_size; i++) { 796 for (size_t i = 0; i < elements_size; i++) {
724 std::wstring s;
725 result = result && ReadParam(m, iter, &(p->elements[i].name)); 797 result = result && ReadParam(m, iter, &(p->elements[i].name));
726 result = result && ReadParam(m, iter, &(p->elements[i].value)); 798 result = result && ReadParam(m, iter, &(p->elements[i].value));
727 } 799 }
728 return result; 800 return result;
729 } 801 }
730 static void Log(const param_type& p, std::wstring* l) { 802 static void Log(const param_type& p, std::wstring* l) {
731 l->append(L"<AutofillForm>"); 803 l->append(L"<AutofillForm>");
732 } 804 }
733 }; 805 };
734 806
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 }; 1821 };
1750 1822
1751 1823
1752 } // namespace IPC 1824 } // namespace IPC
1753 1825
1754 1826
1755 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 1827 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
1756 #include "chrome/common/ipc_message_macros.h" 1828 #include "chrome/common/ipc_message_macros.h"
1757 1829
1758 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 1830 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/browser/views/location_bar_view.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698