b31a4d9751935a9aed577392ccde6d4dd189009a
[platform/framework/web/wrtjs.git] / wrt_app / common / web_application_delegate.ts
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 'use strict';
18
19 import { WebApplication } from '../src/web_application';
20
21 export class WebApplicationDelegate {
22   webApplication: WebApplication;
23   constructor(webApplication: WebApplication) {
24     this.webApplication = webApplication;
25   }
26
27   backgroundExecutable() { return false; }
28   beforeQuit() { }
29   canIgnoreSuspend() { return false; }
30   clearCache() { }
31   clearSuface(webContents: any) { }
32   handleAppControlEvent(appControl: any) { return true; }
33   handleProxyInfo(authInfo: any, callback: any) { return false; }
34   initialize(options: RuntimeOption) { }
35   isPreloading() { return false; }
36   needInpectorGuide() { return false; }
37   needReload(src: string) {
38     let originalUrl = this.webApplication.mainWindow.webContents.getURL();
39     if (src !== originalUrl) {
40       return true;
41     }
42     return false;
43   }
44   needShowTimer() { return true; }
45   onDidFinishLoad() { }
46   profileName() { return 'common' }
47   show() { }
48 }