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

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

Issue 1234653004: webapps: utilize manifest theme colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing include Created 5 years, 4 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 | « chrome/browser/android/shortcut_info.cc ('k') | no next file » | 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/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"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (!related_application.url.is_valid()) 132 if (!related_application.url.is_valid())
133 related_application.url = GURL(); 133 related_application.url = GURL();
134 related_application.id = 134 related_application.id =
135 base::NullableString16(related_application.id.string().substr( 135 base::NullableString16(related_application.id.string().substr(
136 0, Manifest::kMaxIPCStringLength), 136 0, Manifest::kMaxIPCStringLength),
137 related_application.id.is_null()); 137 related_application.id.is_null());
138 } 138 }
139 // theme_color is a 32 bit unsigned integer with a 64 bit integer simply 139 // theme_color is a 32 bit unsigned integer with a 64 bit integer simply
140 // being used to encode an error occuring. Therefore, any value outside the 140 // being used to encode an error occuring. Therefore, any value outside the
141 // range of an unsigned 32 bit integer is invalid. 141 // range of an unsigned 32 bit integer is invalid.
142 if (manifest.theme_color < 0 || manifest.theme_color > 0xFFFFFFFF) 142 if (manifest.theme_color < std::numeric_limits<int32_t>::min() ||
143 manifest.theme_color > std::numeric_limits<int32_t>::max())
143 manifest.theme_color = Manifest::kInvalidOrMissingThemeColor; 144 manifest.theme_color = Manifest::kInvalidOrMissingThemeColor;
144 145
145 callback->Run(manifest); 146 callback->Run(manifest);
146 callbacks->Remove(request_id); 147 callbacks->Remove(request_id);
147 if (callbacks->IsEmpty()) { 148 if (callbacks->IsEmpty()) {
148 delete callbacks; 149 delete callbacks;
149 pending_callbacks_.erase(render_frame_host); 150 pending_callbacks_.erase(render_frame_host);
150 } 151 }
151 } 152 }
152 153
153 } // namespace content 154 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698