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

Side by Side Diff: content/browser/manifest/manifest_manager_host.cc

Issue 1235883007: manifest: add theme_color value to the manifest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nasko's comments Created 5 years, 5 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
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/browser/manifest/manifest_manager_host.h" 5 #include "content/browser/manifest/manifest_manager_host.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "content/common/manifest_manager_messages.h" 8 #include "content/common/manifest_manager_messages.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
11 #include "content/public/common/manifest.h" 11 #include "content/public/common/manifest.h"
12 #include "content/public/common/result_codes.h" 12 #include "content/public/common/result_codes.h"
13 #include "third_party/skia/include/core/SkColor.h"
13 14
14 namespace content { 15 namespace content {
15 16
16 namespace { 17 namespace {
17 18
18 void KillRenderer(RenderFrameHost* render_frame_host) { 19 void KillRenderer(RenderFrameHost* render_frame_host) {
19 base::ProcessHandle process_handle = 20 base::ProcessHandle process_handle =
20 render_frame_host->GetProcess()->GetHandle(); 21 render_frame_host->GetProcess()->GetHandle();
21 if (process_handle == base::kNullProcessHandle) 22 if (process_handle == base::kNullProcessHandle)
22 return; 23 return;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 0, Manifest::kMaxIPCStringLength), 130 0, Manifest::kMaxIPCStringLength),
130 manifest.gcm_sender_id.is_null()); 131 manifest.gcm_sender_id.is_null());
131 for (auto& related_application : manifest.related_applications) { 132 for (auto& related_application : manifest.related_applications) {
132 if (!related_application.url.is_valid()) 133 if (!related_application.url.is_valid())
133 related_application.url = GURL(); 134 related_application.url = GURL();
134 related_application.id = 135 related_application.id =
135 base::NullableString16(related_application.id.string().substr( 136 base::NullableString16(related_application.id.string().substr(
136 0, Manifest::kMaxIPCStringLength), 137 0, Manifest::kMaxIPCStringLength),
137 related_application.id.is_null()); 138 related_application.id.is_null());
138 } 139 }
140 if (manifest.theme_color < SK_ColorBLACK
141 || manifest.theme_color > SK_ColorWHITE)
nasko 2015/07/20 11:07:03 Need {} around the body of the if statement, as it
142 manifest.theme_color = Manifest::kInvalidOrMissingThemeColor;
139 143
140 callback->Run(manifest); 144 callback->Run(manifest);
141 callbacks->Remove(request_id); 145 callbacks->Remove(request_id);
142 if (callbacks->IsEmpty()) { 146 if (callbacks->IsEmpty()) {
143 delete callbacks; 147 delete callbacks;
144 pending_callbacks_.erase(render_frame_host); 148 pending_callbacks_.erase(render_frame_host);
145 } 149 }
146 } 150 }
147 151
148 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/manifest_manager_messages.h » ('j') | content/public/common/manifest.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698