Skip to content

Commit

Permalink
Merge f-t to m-c, a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
philor committed Sep 21, 2015
2 parents 19676d6 + 7c6493b commit 085aeff
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion browser/devtools/webide/themes/panel-listing.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ label,
margin-top: 0;
}

.panel-header[hidden] {
.panel-header[hidden], .panel-item[hidden] {
display: none;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#PopupAutoCompleteRichResult > hbox[anonid="search-suggestions-notification"] {
border-bottom: 1px solid hsla(210, 4%, 10%, 0.14);
color: -moz-FieldText;
background-color: hsla(210, 4%, 10%, 0.07);
padding: 6px 0;
-moz-padding-start: 44px;
Expand Down
1 change: 1 addition & 0 deletions mobile/android/base/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
<category android:name="android.intent.category.APP_BROWSER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Expand Down
16 changes: 14 additions & 2 deletions mobile/android/base/ZoomedView.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class ZoomedView extends FrameLayout implements LayerView.DynamicToolbarL
private int containterSize; // shadow, margin, ...
private Point lastPosition;
private boolean shouldSetVisibleOnUpdate;
private boolean isBlockedFromAppearing; // Prevent the display of the zoomedview while FormAssistantPopup is visible
private PointF returnValue;
private final PointF animationStart;
private ImageView closeButton;
Expand Down Expand Up @@ -228,6 +229,7 @@ public ZoomedView(Context context, AttributeSet attrs) {
public ZoomedView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
isSimplifiedUI = true;
isBlockedFromAppearing = false;
getPrefs();
currentZoomFactorIndex = 0;
returnValue = new PointF();
Expand All @@ -241,7 +243,8 @@ public void run() {
touchListener = new ZoomedViewTouchListener();
EventDispatcher.getInstance().registerGeckoThreadListener(this,
"Gesture:clusteredLinksClicked", "Window:Resize", "Content:LocationChange",
"Gesture:CloseZoomedView", "Browser:ZoomToPageWidth", "Browser:ZoomToRect");
"Gesture:CloseZoomedView", "Browser:ZoomToPageWidth", "Browser:ZoomToRect",
"FormAssist:AutoComplete", "FormAssist:Hide");
}

void destroy() {
Expand All @@ -250,7 +253,8 @@ void destroy() {
ThreadUtils.removeCallbacksFromUiThread(requestRenderRunnable);
EventDispatcher.getInstance().unregisterGeckoThreadListener(this,
"Gesture:clusteredLinksClicked", "Window:Resize", "Content:LocationChange",
"Gesture:CloseZoomedView", "Browser:ZoomToPageWidth", "Browser:ZoomToRect");
"Gesture:CloseZoomedView", "Browser:ZoomToPageWidth", "Browser:ZoomToRect",
"FormAssist:AutoComplete", "FormAssist:Hide");
}

// This method (onFinishInflate) is called only when the zoomed view class is used inside
Expand Down Expand Up @@ -541,6 +545,9 @@ public boolean isObserver() {
}

private void startZoomDisplay(LayerView aLayerView, final int leftFromGecko, final int topFromGecko) {
if (isBlockedFromAppearing) {
return;
}
if (layerView == null) {
layerView = aLayerView;
layerView.addZoomedViewListener(this);
Expand Down Expand Up @@ -625,6 +632,11 @@ public void run() {
event.equals("Browser:ZoomToPageWidth") ||
event.equals("Browser:ZoomToRect")) {
stopZoomDisplay(true);
} else if (event.equals("FormAssist:AutoComplete")) {
isBlockedFromAppearing = true;
stopZoomDisplay(true);
} else if (event.equals("FormAssist:Hide")) {
isBlockedFromAppearing = false;
}
} catch (JSONException e) {
Log.e(LOGTAG, "JSON exception", e);
Expand Down
15 changes: 14 additions & 1 deletion mobile/android/chrome/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4808,10 +4808,12 @@ var BrowserEventHandler = {
break;

case "Gesture:SingleTap": {
let focusedElement = null;
try {
// If the element was previously focused, show the caret attached to it.
let element = this._highlightElement;
if (element && element == BrowserApp.getFocusedInput(BrowserApp.selectedBrowser)) {
focusedElement = BrowserApp.getFocusedInput(BrowserApp.selectedBrowser);
if (element && element == focusedElement) {
let result = SelectionHandler.attachCaret(element);
if (result !== SelectionHandler.ERROR_NONE) {
dump("Unexpected failure during caret attach: " + result);
Expand All @@ -4825,6 +4827,17 @@ var BrowserEventHandler = {
let {x, y} = data;

if (this._inCluster && this._clickInZoomedView != true) {
// If there is a focused element, the display of the zoomed view won't remove the focus.
// In this case, the form assistant linked to the focused element will never be closed.
// To avoid this situation, the focus is moved and the form assistant is closed.
if (focusedElement) {
try {
Services.focus.moveFocus(BrowserApp.selectedBrowser.contentWindow, null, Services.focus.MOVEFOCUS_ROOT, 0);
} catch(e) {
Cu.reportError(e);
}
Messaging.sendRequest({ type: "FormAssist:Hide" });
}
this._clusterClicked(x, y);
} else {
if (this._clickInZoomedView != true) {
Expand Down

0 comments on commit 085aeff

Please sign in to comment.