Bug 806937: Private tabs support for awesomescreen. [r=mfinkle]
This commit is contained in:
@@ -119,12 +119,25 @@ public class AwesomeBar extends GeckoActivity {
|
|||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
String currentUrl = intent.getStringExtra(CURRENT_URL_KEY);
|
String currentUrl = intent.getStringExtra(CURRENT_URL_KEY);
|
||||||
mTarget = intent.getStringExtra(TARGET_KEY);
|
|
||||||
if (currentUrl != null) {
|
if (currentUrl != null) {
|
||||||
mText.setText(currentUrl);
|
mText.setText(currentUrl);
|
||||||
mText.selectAll();
|
mText.selectAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mTarget = intent.getStringExtra(TARGET_KEY);
|
||||||
|
if (mTarget.equals(Target.CURRENT_TAB.name())) {
|
||||||
|
if (Tabs.getInstance().getSelectedTab().isPrivate()) {
|
||||||
|
BrowserToolbarBackground mAddressBarBg = (BrowserToolbarBackground) findViewById(R.id.address_bar_bg);
|
||||||
|
mAddressBarBg.setPrivateMode(true);
|
||||||
|
|
||||||
|
TabsButton mTabs = (TabsButton) findViewById(R.id.dummy_tab);
|
||||||
|
if (mTabs != null)
|
||||||
|
mTabs.setPrivateMode(true);
|
||||||
|
|
||||||
|
mText.setPrivateMode(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mText.setOnKeyPreImeListener(new CustomEditText.OnKeyPreImeListener() {
|
mText.setOnKeyPreImeListener(new CustomEditText.OnKeyPreImeListener() {
|
||||||
public boolean onKeyPreIme(View v, int keyCode, KeyEvent event) {
|
public boolean onKeyPreIme(View v, int keyCode, KeyEvent event) {
|
||||||
// We only want to process one event per tap
|
// We only want to process one event per tap
|
||||||
|
|||||||
@@ -9,9 +9,8 @@ import android.content.Context;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
|
||||||
|
|
||||||
public class CustomEditText extends EditText {
|
public class CustomEditText extends GeckoEditText {
|
||||||
OnKeyPreImeListener mOnKeyPreImeListener;
|
OnKeyPreImeListener mOnKeyPreImeListener;
|
||||||
OnSelectionChangedListener mOnSelectionChangedListener;
|
OnSelectionChangedListener mOnSelectionChangedListener;
|
||||||
OnWindowFocusChangeListener mOnWindowFocusChangeListener;
|
OnWindowFocusChangeListener mOnWindowFocusChangeListener;
|
||||||
@@ -67,4 +66,13 @@ public class CustomEditText extends EditText {
|
|||||||
if (mOnWindowFocusChangeListener != null)
|
if (mOnWindowFocusChangeListener != null)
|
||||||
mOnWindowFocusChangeListener.onWindowFocusChanged(hasFocus);
|
mOnWindowFocusChangeListener.onWindowFocusChanged(hasFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPrivateMode(boolean isPrivate) {
|
||||||
|
super.setPrivateMode(isPrivate);
|
||||||
|
|
||||||
|
// android:textColorHighlight cannot support a ColorStateList.
|
||||||
|
int colorId = isPrivate ? R.color.url_bar_text_highlight_pb : R.color.url_bar_text_highlight;
|
||||||
|
setHighlightColor(getContext().getResources().getColor(colorId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ public final class GeckoViewsFactory implements LayoutInflater.Factory {
|
|||||||
return new LayerView(context, attrs);
|
return new LayerView(context, attrs);
|
||||||
else if (TextUtils.equals(viewName, "Button"))
|
else if (TextUtils.equals(viewName, "Button"))
|
||||||
return new GeckoButton(context, attrs);
|
return new GeckoButton(context, attrs);
|
||||||
|
else if (TextUtils.equals(viewName, "EditText"))
|
||||||
|
return new GeckoEditText(context, attrs);
|
||||||
else if (TextUtils.equals(viewName, "FrameLayout"))
|
else if (TextUtils.equals(viewName, "FrameLayout"))
|
||||||
return new GeckoFrameLayout(context, attrs);
|
return new GeckoFrameLayout(context, attrs);
|
||||||
else if (TextUtils.equals(viewName, "ImageButton"))
|
else if (TextUtils.equals(viewName, "ImageButton"))
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ FENNEC_PP_JAVA_VIEW_FILES = \
|
|||||||
GeckoButton.java \
|
GeckoButton.java \
|
||||||
GeckoImageButton.java \
|
GeckoImageButton.java \
|
||||||
GeckoImageView.java \
|
GeckoImageView.java \
|
||||||
|
GeckoEditText.java \
|
||||||
GeckoFrameLayout.java \
|
GeckoFrameLayout.java \
|
||||||
GeckoLinearLayout.java \
|
GeckoLinearLayout.java \
|
||||||
GeckoRelativeLayout.java \
|
GeckoRelativeLayout.java \
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
|
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
|
||||||
style="@style/AwesomeBar">
|
style="@style/AwesomeBar">
|
||||||
|
|
||||||
<org.mozilla.gecko.BrowserToolbarBackground android:layout_width="fill_parent"
|
<org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
@@ -25,6 +26,8 @@
|
|||||||
android:paddingLeft="15dip"
|
android:paddingLeft="15dip"
|
||||||
android:paddingRight="40dip"
|
android:paddingRight="40dip"
|
||||||
android:hint="@string/awesomebar_default_text"
|
android:hint="@string/awesomebar_default_text"
|
||||||
|
android:textColor="@color/awesome_bar_title"
|
||||||
|
android:textColorHint="@color/awesome_bar_title_hint"
|
||||||
android:textColorHighlight="@color/url_bar_text_highlight"
|
android:textColorHighlight="@color/url_bar_text_highlight"
|
||||||
android:inputType="textUri|textNoSuggestions"
|
android:inputType="textUri|textNoSuggestions"
|
||||||
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
|
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
|
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
|
||||||
style="@style/AwesomeBar">
|
style="@style/AwesomeBar">
|
||||||
|
|
||||||
<org.mozilla.gecko.BrowserToolbarBackground android:layout_width="fill_parent"
|
<org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
@@ -38,6 +39,8 @@
|
|||||||
android:paddingLeft="15dip"
|
android:paddingLeft="15dip"
|
||||||
android:paddingRight="40dip"
|
android:paddingRight="40dip"
|
||||||
android:hint="@string/awesomebar_default_text"
|
android:hint="@string/awesomebar_default_text"
|
||||||
|
android:textColor="@color/awesome_bar_title"
|
||||||
|
android:textColorHint="@color/awesome_bar_title_hint"
|
||||||
android:textColorHighlight="@color/url_bar_text_highlight"
|
android:textColorHighlight="@color/url_bar_text_highlight"
|
||||||
android:inputType="textUri|textNoSuggestions"
|
android:inputType="textUri|textNoSuggestions"
|
||||||
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
|
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
|
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@"
|
||||||
style="@style/AwesomeBar">
|
style="@style/AwesomeBar">
|
||||||
|
|
||||||
<org.mozilla.gecko.BrowserToolbarBackground android:layout_width="fill_parent"
|
<org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
@@ -25,6 +26,8 @@
|
|||||||
android:paddingLeft="15dip"
|
android:paddingLeft="15dip"
|
||||||
android:paddingRight="40dip"
|
android:paddingRight="40dip"
|
||||||
android:hint="@string/awesomebar_default_text"
|
android:hint="@string/awesomebar_default_text"
|
||||||
|
android:textColor="@color/awesome_bar_title"
|
||||||
|
android:textColorHint="@color/awesome_bar_title_hint"
|
||||||
android:textColorHighlight="@color/url_bar_text_highlight"
|
android:textColorHighlight="@color/url_bar_text_highlight"
|
||||||
android:inputType="textUri|textNoSuggestions"
|
android:inputType="textUri|textNoSuggestions"
|
||||||
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
|
android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
<color name="validation_message_text">#ffffff</color>
|
<color name="validation_message_text">#ffffff</color>
|
||||||
<color name="identity_verified">#77BAFF</color>
|
<color name="identity_verified">#77BAFF</color>
|
||||||
<color name="identity_identified">#B7D46A</color>
|
<color name="identity_identified">#B7D46A</color>
|
||||||
<color name="url_bar_text_highlight">#FF9500</color>
|
<color name="url_bar_text_highlight">#FFFF9500</color>
|
||||||
|
<color name="url_bar_text_highlight_pb">#FFD06BFF</color>
|
||||||
<color name="suggestion_primary">#dddddd</color>
|
<color name="suggestion_primary">#dddddd</color>
|
||||||
<color name="suggestion_pressed">#bbbbbb</color>
|
<color name="suggestion_pressed">#bbbbbb</color>
|
||||||
<color name="abouthome_topsite_shadow">#1000</color>
|
<color name="abouthome_topsite_shadow">#1000</color>
|
||||||
|
|||||||
Reference in New Issue
Block a user