Commit f5d5cf27 authored by Tatiana Meshkova's avatar Tatiana Meshkova

Merged with upstream gecko d35342e7bcd0

parent 0bdfca28
......@@ -15,6 +15,8 @@
#include "nsIDOMWindow.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMEvent.h"
#include "nsIURI.h"
#include "nsIDOMDocument.h"
#include "nsPIDOMWindow.h"
#include "nsIEmbedLiteJSON.h"
#include "nsComponentManagerUtils.h"
......
......@@ -30,7 +30,6 @@ EmbedHistoryListener::GetSingleton()
EmbedHistoryListener::EmbedHistoryListener()
{
mListeners.Init();
nsresult rv;
nsCOMPtr<nsIObserverService> observerService =
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
......
......@@ -75,7 +75,7 @@ var UserAgent = {
getUserAgentForUriAndTab: function ua_getUserAgentForUriAndTab(aUri, defaultUA) {
// Send desktop UA if "Request Desktop Site" is enabled.
if (this._desktopMode)
// if (this._desktopMode)
return this.DESKTOP_UA;
// Not all schemes have a host member.
......@@ -87,10 +87,10 @@ var UserAgent = {
}
} else if (this.YOUTUBE_DOMAIN.test(aUri.host) || this.FACEBOOK_DOMAIN.test(aUri.host)) {
// Send the phone UA to google
if (!defaultUA.contains("Safari/535.19")) {
// if (!defaultUA.contains("Safari/535.19")) {
// Nexus 7 Android chrome has best capabilities
return defaultUA.replace("X11", "Android 4.4.1").replace("Unix", "Android 4.4.1").concat(" Safari/535.19");
}
// return defaultUA.replace("X11", "Android 4.4.1").replace("Unix", "Android 4.4.1").concat(" Safari/535.19");
// }
} else if (this.NOKIA_HERE_DOMAIN.test(aUri.host)) {
// Send the phone UA to here
if (!defaultUA.contains("Mobile")) {
......
......@@ -11,7 +11,9 @@
#include "nsStringGlue.h"
#include "nsIAuthPrompt.h"
#include "nsISupportsImpl.h"
#include "nsThreadUtils.h"
#include "nsIDOMWindowUtils.h"
#include "nsIThread.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIInterfaceRequestor.h"
#include "nsIURI.h"
......@@ -234,8 +236,7 @@ EmbedPromptService::AlertCheck(const PRUnichar* aDialogTitle,
nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(mWin);
NS_ENSURE_TRUE(utils, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMWindow> modalStateWin;
rv = utils->EnterModalStateWithWindow(getter_AddRefs(modalStateWin));
rv = utils->EnterModalState();
mModalDepth++;
int origModalDepth = mModalDepth;
......@@ -265,7 +266,7 @@ EmbedPromptService::AlertCheck(const PRUnichar* aDialogTitle,
mResponseMap.erase(it);
rv = utils->LeaveModalStateWithWindow(modalStateWin);
rv = utils->LeaveModalState();
mService->LeaveSecureJSContext();
......@@ -320,8 +321,7 @@ EmbedPromptService::ConfirmCheck(const PRUnichar* aDialogTitle,
nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(mWin);
NS_ENSURE_TRUE(utils, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMWindow> modalStateWin;
rv = utils->EnterModalStateWithWindow(getter_AddRefs(modalStateWin));
rv = utils->EnterModalState();
mModalDepth++;
int origModalDepth = mModalDepth;
......@@ -355,7 +355,7 @@ EmbedPromptService::ConfirmCheck(const PRUnichar* aDialogTitle,
mResponseMap.erase(it);
rv = utils->LeaveModalStateWithWindow(modalStateWin);
rv = utils->LeaveModalState();
mService->LeaveSecureJSContext();
......@@ -417,8 +417,7 @@ EmbedPromptService::Prompt(const PRUnichar* aDialogTitle,
nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(mWin);
NS_ENSURE_TRUE(utils, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMWindow> modalStateWin;
rv = utils->EnterModalStateWithWindow(getter_AddRefs(modalStateWin));
rv = utils->EnterModalState();
mModalDepth++;
int origModalDepth = mModalDepth;
......@@ -458,7 +457,7 @@ EmbedPromptService::Prompt(const PRUnichar* aDialogTitle,
mResponseMap.erase(it);
rv = utils->LeaveModalStateWithWindow(modalStateWin);
rv = utils->LeaveModalState();
mService->LeaveSecureJSContext();
......
......@@ -18,16 +18,14 @@
using namespace mozilla;
NS_IMPL_THREADSAFE_ISUPPORTS2(nsEmbedAlertsService, nsIAlertsService, nsIAlertsProgressListener)
NS_IMPL_ISUPPORTS2(nsEmbedAlertsService, nsIAlertsService, nsIAlertsProgressListener)
nsEmbedAlertsService::nsEmbedAlertsService()
{
printf(">>>>>>Func:%s::%d\n", __PRETTY_FUNCTION__, __LINE__);
}
nsEmbedAlertsService::~nsEmbedAlertsService()
{
printf(">>>>>>Func:%s::%d\n", __PRETTY_FUNCTION__, __LINE__);
}
bool nsEmbedAlertsService::ShouldShowAlert()
......
......@@ -13,6 +13,10 @@
#include "nsStringGlue.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIDOMWindow.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDocument.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMEvent.h"
#include "nsPIDOMWindow.h"
......@@ -70,7 +74,8 @@ void EmbedTouchListener::HandleLongTap(const CSSIntPoint& aPoint)
LOGT("pt[%i,%i]", aPoint.x, aPoint.y);
}
void EmbedTouchListener::SendAsyncScrollDOMEvent(const mozilla::CSSRect& aRect,
void EmbedTouchListener::SendAsyncScrollDOMEvent(mozilla::layers::FrameMetrics::ViewID,
const mozilla::CSSRect& aRect,
const mozilla::CSSSize& aSize)
{
// LOGT("r[%g,%g,%g,%g], size[%g,%g]", aRect.x, aRect.y, aRect.width, aRect.height, aSize.width, aSize.height);
......@@ -436,7 +441,8 @@ EmbedTouchListener::GetFocusedInput(nsIDOMElement* *aElement,
if (input) {
bool isText = false;
if (NS_SUCCEEDED(input->MozIsTextField(false, &isText)) && isText) {
NS_ADDREF(*aElement = input);
nsCOMPtr<nsIDOMElement> inputel = do_QueryInterface(input);
*aElement = inputel.forget().get();
return NS_OK;
}
}
......
......@@ -39,7 +39,7 @@ public:
virtual void HandleDoubleTap(const mozilla::CSSIntPoint&);
virtual void HandleSingleTap(const mozilla::CSSIntPoint&);
virtual void HandleLongTap(const mozilla::CSSIntPoint&);
virtual void SendAsyncScrollDOMEvent(const mozilla::CSSRect&, const mozilla::CSSSize&);
virtual void SendAsyncScrollDOMEvent(mozilla::layers::FrameMetrics::ViewID, const mozilla::CSSRect&, const mozilla::CSSSize&);
virtual void ScrollUpdate(const mozilla::CSSPoint&, float);
virtual void PostDelayedTask(Task*, int) {}
......
......@@ -11,6 +11,8 @@
#include "nsIEmbedLiteJSON.h"
#include "nsNetUtil.h"
#include "nsIURI.h"
#include "nsIThread.h"
#include "nsThreadUtils.h"
#include "nsIVariant.h"
#include "nsArrayEnumerator.h"
#include "nsIDOMFile.h"
......@@ -166,6 +168,12 @@ NS_IMETHODIMP nsEmbedFilePicker::SetAddToRecentDocs(bool aAddToRecentDocs)
return NS_OK;
}
NS_IMETHODIMP nsEmbedFilePicker::GetMode(int16_t *aMode)
{
*aMode = mMode;
return NS_OK;
}
NS_IMETHODIMP nsEmbedFilePicker::Show(int16_t* _retval)
{
DoSendPrompt();
......@@ -177,8 +185,7 @@ NS_IMETHODIMP nsEmbedFilePicker::Show(int16_t* _retval)
nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(mWin);
NS_ENSURE_TRUE(utils, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMWindow> modalStateWin;
rv = utils->EnterModalStateWithWindow(getter_AddRefs(modalStateWin));
rv = utils->EnterModalState();
mModalDepth++;
int origModalDepth = mModalDepth;
......@@ -201,7 +208,7 @@ NS_IMETHODIMP nsEmbedFilePicker::Show(int16_t* _retval)
return NS_ERROR_UNEXPECTED;
}
rv = utils->LeaveModalStateWithWindow(modalStateWin);
rv = utils->LeaveModalState();
mService->LeaveSecureJSContext();
return rv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment