2011-12-08 17:37:57 +00:00
|
|
|
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
2012-05-21 11:12:37 +00:00
|
|
|
* 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/. */
|
2011-12-08 17:37:57 +00:00
|
|
|
|
2013-11-11 18:41:16 +00:00
|
|
|
package org.mozilla.gecko.preferences;
|
|
|
|
|
|
|
|
import org.mozilla.gecko.Tabs;
|
2011-12-08 17:37:57 +00:00
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.preference.Preference;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
|
|
|
|
class LinkPreference extends Preference {
|
2014-10-10 23:17:01 +00:00
|
|
|
private final String mUrl;
|
2011-12-08 17:37:57 +00:00
|
|
|
|
|
|
|
public LinkPreference(Context context, AttributeSet attrs) {
|
|
|
|
super(context, attrs);
|
|
|
|
mUrl = attrs.getAttributeValue(null, "url");
|
|
|
|
}
|
|
|
|
public LinkPreference(Context context, AttributeSet attrs, int defStyle) {
|
|
|
|
super(context, attrs, defStyle);
|
|
|
|
mUrl = attrs.getAttributeValue(null, "url");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onClick() {
|
2012-10-05 21:51:18 +00:00
|
|
|
Tabs.getInstance().loadUrlInTab(mUrl);
|
2011-12-08 17:37:57 +00:00
|
|
|
callChangeListener(mUrl);
|
|
|
|
}
|
|
|
|
}
|