()
| 541 | } |
| 542 | |
| 543 | private getDefaultClipMode(): ClipMode { |
| 544 | if (this.state && this.state.invokeOptions) { |
| 545 | switch (this.state.invokeOptions.invokeMode) { |
| 546 | case InvokeMode.ContextImage: |
| 547 | // We don't want to be stuck in region mode if there are 0 images |
| 548 | if (this.state.regionResult.data.length > 0) { |
| 549 | return ClipMode.Region; |
| 550 | } |
| 551 | break; |
| 552 | case InvokeMode.ContextTextSelection: |
| 553 | return ClipMode.Selection; |
| 554 | default: |
| 555 | break; |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | if (this.state && this.state.pageInfo) { |
| 560 | if (this.state.pageInfo.contentType === OneNoteApi.ContentType.EnhancedUrl) { |
| 561 | return ClipMode.Pdf; |
| 562 | } |
| 563 | |
| 564 | if (UrlUtils.onWhitelistedDomain(this.state.pageInfo.rawUrl)) { |
| 565 | return ClipMode.Augmentation; |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | return ClipMode.FullPage; |
| 570 | } |
| 571 | |
| 572 | private updateFrameHeight(newContainerHeight: number) { |
| 573 | Clipper.getInjectCommunicator().callRemoteFunction(Constants.FunctionKeys.updateFrameHeight, { param: newContainerHeight }); |
no outgoing calls
no test coverage detected