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

Side by Side Diff: chrome/browser/banners/app_banner_manager.cc

Issue 2915913002: [WebAPKs] Display same text for menu & engagement banner (Closed)
Patch Set: Merge branch 'master' into same_infobar_title Created 3 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/banners/app_banner_manager.h" 5 #include "chrome/browser/banners/app_banner_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 if (!is_active()) 214 if (!is_active())
215 return; 215 return;
216 216
217 DCHECK(!data.manifest_url.is_empty()); 217 DCHECK(!data.manifest_url.is_empty());
218 DCHECK(!data.manifest.IsEmpty()); 218 DCHECK(!data.manifest.IsEmpty());
219 219
220 manifest_url_ = data.manifest_url; 220 manifest_url_ = data.manifest_url;
221 manifest_ = data.manifest; 221 manifest_ = data.manifest;
222 222
223 // One of manifest_.name or manifest_.short_name must be non-null and
224 // non-empty if the error code was NO_ERROR_DETECTED.
225 if (manifest_.name.is_null() || manifest_.name.string().empty())
226 app_title_ = manifest_.short_name.string();
227 else
228 app_title_ = manifest_.name.string();
229
230 PerformInstallableCheck(); 223 PerformInstallableCheck();
231 } 224 }
232 225
233 InstallableParams AppBannerManager::ParamsToPerformInstallableCheck() { 226 InstallableParams AppBannerManager::ParamsToPerformInstallableCheck() {
234 InstallableParams params; 227 InstallableParams params;
235 params.ideal_primary_icon_size_in_px = GetIdealPrimaryIconSizeInPx(); 228 params.ideal_primary_icon_size_in_px = GetIdealPrimaryIconSizeInPx();
236 params.minimum_primary_icon_size_in_px = GetMinimumPrimaryIconSizeInPx(); 229 params.minimum_primary_icon_size_in_px = GetMinimumPrimaryIconSizeInPx();
237 params.check_installable = true; 230 params.check_installable = true;
238 params.fetch_valid_primary_icon = true; 231 params.fetch_valid_primary_icon = true;
239 232
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 if (is_pending_event()) { 553 if (is_pending_event()) {
561 // Simulate a non-canceled OnBannerPromptReply to show the delayed banner. 554 // Simulate a non-canceled OnBannerPromptReply to show the delayed banner.
562 OnBannerPromptReply(blink::mojom::AppBannerPromptReply::NONE, referrer_); 555 OnBannerPromptReply(blink::mojom::AppBannerPromptReply::NONE, referrer_);
563 } else { 556 } else {
564 // Log that the prompt request was made for when we get the prompt reply. 557 // Log that the prompt request was made for when we get the prompt reply.
565 page_requested_prompt_ = true; 558 page_requested_prompt_ = true;
566 } 559 }
567 } 560 }
568 561
569 } // namespace banners 562 } // namespace banners
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698