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

Side by Side Diff: content/renderer/manifest/manifest_manager.cc

Issue 580513002: Add support for gcm_sender_id in Manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manifest_start_url
Patch Set: Created 6 years, 2 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
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('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 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 "content/renderer/manifest/manifest_manager.h" 5 #include "content/renderer/manifest/manifest_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/nullable_string16.h" 8 #include "base/strings/nullable_string16.h"
9 #include "content/common/manifest_manager_messages.h" 9 #include "content/common/manifest_manager_messages.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 ipc_manifest.short_name = base::NullableString16( 58 ipc_manifest.short_name = base::NullableString16(
59 ipc_manifest.short_name.string().substr(0, 59 ipc_manifest.short_name.string().substr(0,
60 Manifest::kMaxIPCStringLength), 60 Manifest::kMaxIPCStringLength),
61 ipc_manifest.short_name.is_null()); 61 ipc_manifest.short_name.is_null());
62 for (size_t i = 0; i < ipc_manifest.icons.size(); ++i) { 62 for (size_t i = 0; i < ipc_manifest.icons.size(); ++i) {
63 ipc_manifest.icons[i].type = base::NullableString16( 63 ipc_manifest.icons[i].type = base::NullableString16(
64 ipc_manifest.icons[i].type.string().substr( 64 ipc_manifest.icons[i].type.string().substr(
65 0, Manifest::kMaxIPCStringLength), 65 0, Manifest::kMaxIPCStringLength),
66 ipc_manifest.icons[i].type.is_null()); 66 ipc_manifest.icons[i].type.is_null());
67 } 67 }
68 ipc_manifest.gcm_sender_id = base::NullableString16(
69 ipc_manifest.gcm_sender_id.string().substr(
70 0, Manifest::kMaxIPCStringLength),
71 ipc_manifest.gcm_sender_id.is_null());
68 72
69 Send(new ManifestManagerHostMsg_RequestManifestResponse( 73 Send(new ManifestManagerHostMsg_RequestManifestResponse(
70 routing_id(), request_id, ipc_manifest)); 74 routing_id(), request_id, ipc_manifest));
71 } 75 }
72 76
73 void ManifestManager::GetManifest(const GetManifestCallback& callback) { 77 void ManifestManager::GetManifest(const GetManifestCallback& callback) {
74 if (!may_have_manifest_) { 78 if (!may_have_manifest_) {
75 callback.Run(Manifest()); 79 callback.Run(Manifest());
76 return; 80 return;
77 } 81 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 143
140 pending_callbacks_.clear(); 144 pending_callbacks_.clear();
141 145
142 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin(); 146 for (std::list<GetManifestCallback>::const_iterator it = callbacks.begin();
143 it != callbacks.end(); ++it) { 147 it != callbacks.end(); ++it) {
144 it->Run(manifest); 148 it->Run(manifest);
145 } 149 }
146 } 150 }
147 151
148 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698