<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import UIKit

protocol BrowserToolbarDelegate {
    func didClickBack()
    func didClickForward()
    func didEnterURL(url: NSURL)
}

class BrowserToolbar: UIToolbar, UITextFieldDelegate {
    var browserToolbarDelegate: BrowserToolbarDelegate?

    private var urlTextField: UITextField!

    override init() {
        super.init()
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        viewDidInit()
    }

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        viewDidInit()
    }

    private func viewDidInit() {
        let backButton = UIButton()
        backButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        backButton.setTitle("<", forState: UIControlState.Normal)
        backButton.addTarget(self, action: "SELdidClickBack", forControlEvents: UIControlEvents.TouchUpInside)
        let backButtonItem = UIBarButtonItem()
        backButtonItem.customView = backButton

        let forwardButton = UIButton()
        forwardButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        forwardButton.setTitle(">", forState: UIControlState.Normal)
        forwardButton.addTarget(self, action: "SELdidClickForward", forControlEvents: UIControlEvents.TouchUpInside)
        let forwardButtonItem = UIBarButtonItem()
        forwardButtonItem.customView = forwardButton

        urlTextField = ToolbarTextField()
        urlTextField.keyboardType = UIKeyboardType.URL
        urlTextField.autocorrectionType = UITextAutocorrectionType.No
        urlTextField.layer.backgroundColor = UIColor.whiteColor().CGColor<commit_msg>Fixes 1109651 - The location text field must not be set to auto capitalize<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import UIKit

protocol BrowserToolbarDelegate {
    func didClickBack()
    func didClickForward()
    func didEnterURL(url: NSURL)
}

class BrowserToolbar: UIToolbar, UITextFieldDelegate {
    var browserToolbarDelegate: BrowserToolbarDelegate?

    private var urlTextField: UITextField!

    override init() {
        super.init()
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        viewDidInit()
    }

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        viewDidInit()
    }

    private func viewDidInit() {
        let backButton = UIButton()
        backButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        backButton.setTitle("<", forState: UIControlState.Normal)
        backButton.addTarget(self, action: "SELdidClickBack", forControlEvents: UIControlEvents.TouchUpInside)
        let backButtonItem = UIBarButtonItem()
        backButtonItem.customView = backButton

        let forwardButton = UIButton()
        forwardButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        forwardButton.setTitle(">", forState: UIControlState.Normal)
        forwardButton.addTarget(self, action: "SELdidClickForward", forControlEvents: UIControlEvents.TouchUpInside)
        let forwardButtonItem = UIBarButtonItem()
        forwardButtonItem.customView = forwardButton

        urlTextField = ToolbarTextField()
        urlTextField.keyboardType = UIKeyboardType.URL
        urlTextField.autocorrectionType = UITextAutocorrectionType.No
        urlTextField.autocapitalizationType = UITextAutocapitalizationType.None
        urlTextField.layer.backgroundColor = UIColor.whiteColor().CGColor
{'fraction_non_alphanumeric': 0.08220576972172582, 'fraction_numerical': 0.0038294613224406433, 'mean_word_length': 3.5771028037383177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7547956', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1079, 'n_words': 261}