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

Side by Side Diff: third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Rebase Created 5 years 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 "config.h" 5 #include "config.h"
6 #include "modules/app_banner/AppBannerController.h" 6 #include "modules/app_banner/AppBannerController.h"
7 7
8 #include "core/EventTypeNames.h" 8 #include "core/EventTypeNames.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/DOMWindow.h" 10 #include "core/frame/DOMWindow.h"
(...skipping 10 matching lines...) Expand all
21 void AppBannerController::willShowInstallBannerPrompt(int requestId, WebAppBanne rClient* client, LocalFrame* frame, const WebVector<WebString>& platforms, WebAp pBannerPromptReply* reply) 21 void AppBannerController::willShowInstallBannerPrompt(int requestId, WebAppBanne rClient* client, LocalFrame* frame, const WebVector<WebString>& platforms, WebAp pBannerPromptReply* reply)
22 { 22 {
23 ASSERT(RuntimeEnabledFeatures::appBannerEnabled()); 23 ASSERT(RuntimeEnabledFeatures::appBannerEnabled());
24 24
25 Vector<String> wtfPlatforms; 25 Vector<String> wtfPlatforms;
26 for (const WebString& platform : platforms) 26 for (const WebString& platform : platforms)
27 wtfPlatforms.append(platform); 27 wtfPlatforms.append(platform);
28 28
29 // dispatchEvent() returns whether the default behavior can happen. In other 29 // dispatchEvent() returns whether the default behavior can happen. In other
30 // words, it returns false if preventDefault() was called. 30 // words, it returns false if preventDefault() was called.
31 *reply = frame->domWindow()->dispatchEvent(BeforeInstallPromptEvent::create( EventTypeNames::beforeinstallprompt, frame->document(), wtfPlatforms, requestId, client)) 31 *reply = frame->domWindow()->dispatchEvent(BeforeInstallPromptEvent::create( EventTypeNames::beforeinstallprompt, frame->document(), wtfPlatforms, requestId, client)) == WebInputEventResult::NotHandled
32 ? WebAppBannerPromptReply::None : WebAppBannerPromptReply::Cancel; 32 ? WebAppBannerPromptReply::None
33 : WebAppBannerPromptReply::Cancel;
33 } 34 }
34 35
35 } // namespace blink 36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698