     }
 
     private func setupConstraints() {
-        tabsButton.snp_makeConstraints { make in
-            make.centerY.equalTo(self.locationContainer)
-            make.trailing.equalTo(self)
-            make.width.height.equalTo(AppConstants.ToolbarHeight)
-        }
-
         progressBar.snp_makeConstraints { make in
             make.top.equalTo(self.snp_bottom)
             make.width.equalTo(self)

    }

    func updateTabCount(count: Int) {
        self.tabsButton.setTitle(count.description, forState: .Normal)
        // Make a clone of the tabs button.
        let newTabsButton = self.tabsButton.clone() as! UIButton
        addSubview(newTabsButton)

        // Copy constraints from original button, offset by the anchor position.
        newTabsButton.snp_makeConstraints { make in
            make.size.centerX.equalTo(tabsButton)
            make.centerY.equalTo(self.tabsButton).offset((URLBarViewUX.TabsButtonRotationOffset - 0.5) * URLBarViewUX.TabsButtonHeight)
        }

        // Set the anchor to the bottom of the label so it flips up.
        newTabsButton.titleLabel?.layer.anchorPoint = CGPoint(x: 0.5, y: URLBarViewUX.TabsButtonRotationOffset)

        // Set up the rotation matrix.
        var flipTransform = CATransform3DIdentity
        flipTransform.m34 = -1.0 / 200.0 // add some perspective
        flipTransform = CATransform3DRotate(flipTransform, CGFloat(-M_PI_2), 1.0, 0.0, 0.0)
        newTabsButton.titleLabel?.layer.transform = flipTransform

        // Offset the target rotation by 180º so the new tab comes from the front and the old tab falls back.
        flipTransform = CATransform3DRotate(flipTransform, CGFloat(M_PI), 1.0, 0.0, 0.0)

        // Force any in progress animation to end.
        self.tabsButton.alpha = 1
        UIView.animateWithDuration(1.0, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.0, options: .CurveEaseInOut | .BeginFromCurrentState, animations: { _ in
                newTabsButton.titleLabel?.layer.transform = CATransform3DIdentity
                self.tabsButton.titleLabel?.layer.transform = flipTransform
                self.tabsButton.alpha = 0
            }, completion: { finished in
                // Remove the clone and set up the actual tabs button.
                newTabsButton.removeFromSuperview()
                if finished {
                    self.tabsButton.alpha = 1
                    self.tabsButton.titleLabel?.layer.transform = CATransform3DIdentity
                    self.tabsButton.setTitle(count.description, forState: UIControlState.Normal)
                    self.tabsButton.accessibilityValue = count.description
                }
        })
    }

    func updateProgressBar(progress: Float) {

    override func updateConstraints() {
        updateToolbarConstraints()

        tabsButton.snp_remakeConstraints { make in
            make.centerY.equalTo(self.locationContainer)
            make.trailing.equalTo(self)
            make.width.height.equalTo(AppConstants.ToolbarHeight)
        }

        // Add an offset to the left for slide animation, and a bit of extra offset for spring bounces
        let leftOffset: CGFloat = self.tabsButton.frame.width + URLBarViewUX.URLBarCurveOffset + URLBarViewUX.URLBarCurveBounceBuffer
        self.curveShape.snp_remakeConstraints { make in
