Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/banners/app_banner_manager_emulation.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "build/build_config.h" | |
| 9 #include "chrome/browser/banners/app_banner_data_fetcher_desktop.h" | |
| 10 #include "ui/display/screen.h" | |
| 11 | |
| 12 namespace { | |
| 13 | |
| 14 // We need to provide web developers with the guidance on the minimum icon | |
| 15 // size they should list in the manifest. Since the size depends on the | |
| 16 // device, we pick the baseline being a Nexus 5X-alike device. | |
| 17 // We make it clear in the 'add to home screen' emulation UI that the | |
|
dominickn
2016/05/06 18:29:47
Nit: It would be nice if it was also stated in the
pfeldman
2016/05/06 18:40:01
We'll get this messaging aligned with Jake.
| |
| 18 // size does not correspond to the currently emulated device, but rather is | |
| 19 // a generic baseline. | |
| 20 int kMinimumIconSize = 192; | |
|
dominickn
2016/05/06 18:29:47
I think this should be 144px - that has been the a
pfeldman
2016/05/06 18:40:01
Done.
| |
| 21 | |
| 22 } // anonymous namespace | |
| 23 | |
| 24 DEFINE_WEB_CONTENTS_USER_DATA_KEY(banners::AppBannerManagerEmulation); | |
| 25 | |
| 26 namespace banners { | |
| 27 | |
| 28 AppBannerDataFetcher* AppBannerManagerEmulation::CreateAppBannerDataFetcher( | |
| 29 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, | |
| 30 bool is_debug_mode) { | |
| 31 | |
|
dominickn
2016/05/06 18:29:46
Nit: add a comment along the lines of "Divide by t
pfeldman
2016/05/06 18:40:01
Done.
| |
| 32 int size = kMinimumIconSize / display::Screen::GetScreen()-> | |
| 33 GetPrimaryDisplay().device_scale_factor(); | |
| 34 | |
| 35 return new AppBannerDataFetcherDesktop(web_contents(), weak_delegate, | |
| 36 size, size, true); | |
|
dominickn
2016/05/06 18:29:46
Nit: pass through is_debug_mode for consistency.
pfeldman
2016/05/06 18:40:01
Done.
| |
| 37 } | |
| 38 | |
| 39 AppBannerManagerEmulation::AppBannerManagerEmulation( | |
| 40 content::WebContents* web_contents) | |
| 41 : AppBannerManager(web_contents) { | |
| 42 } | |
| 43 | |
| 44 } // namespace banners | |
| OLD | NEW |