1// Copyright 2019 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#import "ios/chrome/browser/ui/qr_scanner/qr_scanner_view.h"
6
7#import "ios/chrome/browser/ui/util/ui_util.h"
8#include "ios/chrome/grit/ios_strings.h"
9#include "ui/base/l10n/l10n_util.h"
10#include "ui/base/l10n/l10n_util_mac.h"
11
12#if !defined(__has_feature) || !__has_feature(objc_arc)
13#error "This file requires ARC support."
14#endif
15
16namespace {
17
18// Width and height of the QR scanner viewport.
19const CGSize kViewportSizeIPhone = CGSizeMake(250, 250);
20const CGSize kViewportSizeIPad = CGSizeMake(300, 300);
21
22}  // namespace
23
24@implementation QRScannerView
25
26#pragma mark - ScannerView
27
28- (CGSize)viewportSize {
29  return IsIPadIdiom() ? kViewportSizeIPad : kViewportSizeIPhone;
30}
31
32- (NSString*)caption {
33  return l10n_util::GetNSString(IDS_IOS_QR_SCANNER_VIEWPORT_CAPTION);
34}
35
36@end
37