OLD | NEW |
---|---|
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_debug_log.h" | 5 #include "chrome/browser/banners/app_banner_debug_log.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 "one of manifest name or short name must be specified"; | 32 "one of manifest name or short name must be specified"; |
33 const char kManifestMissingSuitableIcon[] = | 33 const char kManifestMissingSuitableIcon[] = |
34 "manifest does not contain a suitable icon - PNG format of at least " | 34 "manifest does not contain a suitable icon - PNG format of at least " |
35 "144x144px is required"; | 35 "144x144px is required"; |
36 const char kNotServedFromSecureOrigin[] = | 36 const char kNotServedFromSecureOrigin[] = |
37 "page not served from a secure origin"; | 37 "page not served from a secure origin"; |
38 // The leading space is intentional as another string is prepended. | 38 // The leading space is intentional as another string is prepended. |
39 const char kIgnoredNotSupportedOnAndroid[] = | 39 const char kIgnoredNotSupportedOnAndroid[] = |
40 " application ignored: not supported on Android"; | 40 " application ignored: not supported on Android"; |
41 const char kIgnoredNoId[] = "play application ignored: no id provided"; | 41 const char kIgnoredNoId[] = "play application ignored: no id provided"; |
42 const char kAddMetaViewportTag[] = | |
43 "Please check that your site displays appropriately on mobile, and add the " | |
44 "meta viewport tag with content width=device-width or initial-scale=1"; | |
45 // The trailing spaces are intentional as another string is appended. | |
46 const char kMetaViewportTagNotResponsive[] = | |
benwells
2015/05/27 05:58:55
Why are there two strings when they are appended t
dominickn (DO NOT USE)
2015/06/05 07:42:59
Done.
| |
47 "meta viewport tag not detected, or it contains no indication that your " | |
48 "site scales for mobile devices. "; | |
42 | 49 |
43 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, | 50 void OutputDeveloperNotShownMessage(content::WebContents* web_contents, |
44 const std::string& message) { | 51 const std::string& message) { |
45 OutputDeveloperDebugMessage(web_contents, "not shown: " + message); | 52 OutputDeveloperDebugMessage(web_contents, "not shown: " + message); |
46 } | 53 } |
47 | 54 |
55 void OutputDeveloperMetaViewportErrorMessage(content::WebContents* web_contents, | |
56 const std::string& message) { | |
57 OutputDeveloperNotShownMessage(web_contents, message + kAddMetaViewportTag); | |
58 } | |
59 | |
48 void OutputDeveloperDebugMessage(content::WebContents* web_contents, | 60 void OutputDeveloperDebugMessage(content::WebContents* web_contents, |
49 const std::string& message) { | 61 const std::string& message) { |
50 std::string log_message = "App banner " + message; | 62 std::string log_message = "App banner " + message; |
51 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 63 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
52 switches::kBypassAppBannerEngagementChecks) && web_contents) { | 64 switches::kBypassAppBannerEngagementChecks) && web_contents) { |
53 web_contents->GetMainFrame()->Send( | 65 web_contents->GetMainFrame()->Send( |
54 new ChromeViewMsg_AppBannerDebugMessageRequest( | 66 new ChromeViewMsg_AppBannerDebugMessageRequest( |
55 web_contents->GetMainFrame()->GetRoutingID(), log_message)); | 67 web_contents->GetMainFrame()->GetRoutingID(), log_message)); |
56 } | 68 } |
57 } | 69 } |
58 | 70 |
59 } // namespace banners | 71 } // namespace banners |
OLD | NEW |