Commit 863c0cf6 authored by guohui@chromium.org's avatar guohui@chromium.org

Disable context menu for constrained inline signin

BUG=380134

Review URL: https://codereview.chromium.org/336583002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276901 0039d316-1c4b-4281-b951-d872f2087c98
parent 42a3ff57
...@@ -186,11 +186,26 @@ InlineLoginHandlerImpl::InlineLoginHandlerImpl() ...@@ -186,11 +186,26 @@ InlineLoginHandlerImpl::InlineLoginHandlerImpl()
InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {} InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {}
bool InlineLoginHandlerImpl::HandleContextMenu(
const content::ContextMenuParams& params) {
#ifndef NDEBUG
return false;
#else
return true;
#endif
}
void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) { void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) {
params.SetString("service", "chromiumsync"); params.SetString("service", "chromiumsync");
signin::Source source = content::WebContents* contents = web_ui()->GetWebContents();
signin::GetSourceForPromoURL(web_ui()->GetWebContents()->GetURL()); const GURL& current_url = contents->GetURL();
std::string is_constrained;
net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained);
if (is_constrained == "1")
contents->SetDelegate(this);
signin::Source source = signin::GetSourceForPromoURL(current_url);
OneClickSigninHelper::LogHistogramValue( OneClickSigninHelper::LogHistogramValue(
source, one_click_signin::HISTOGRAM_SHOWN); source, one_click_signin::HISTOGRAM_SHOWN);
} }
......
...@@ -11,13 +11,15 @@ ...@@ -11,13 +11,15 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
#include "chrome/browser/ui/webui/signin/inline_login_handler.h" #include "chrome/browser/ui/webui/signin/inline_login_handler.h"
#include "content/public/browser/web_contents_delegate.h"
class GaiaAuthFetcher; class GaiaAuthFetcher;
// Implementation for the inline login WebUI handler on desktop Chrome. Once // Implementation for the inline login WebUI handler on desktop Chrome. Once
// CrOS migrates to the same webview approach as desktop Chrome, much of the // CrOS migrates to the same webview approach as desktop Chrome, much of the
// code in this class should move to its base class |InlineLoginHandler|. // code in this class should move to its base class |InlineLoginHandler|.
class InlineLoginHandlerImpl : public InlineLoginHandler { class InlineLoginHandlerImpl : public InlineLoginHandler,
public content::WebContentsDelegate {
public: public:
InlineLoginHandlerImpl(); InlineLoginHandlerImpl();
virtual ~InlineLoginHandlerImpl(); virtual ~InlineLoginHandlerImpl();
...@@ -38,6 +40,10 @@ class InlineLoginHandlerImpl : public InlineLoginHandler { ...@@ -38,6 +40,10 @@ class InlineLoginHandlerImpl : public InlineLoginHandler {
virtual void SetExtraInitParams(base::DictionaryValue& params) OVERRIDE; virtual void SetExtraInitParams(base::DictionaryValue& params) OVERRIDE;
virtual void CompleteLogin(const base::ListValue* args) OVERRIDE; virtual void CompleteLogin(const base::ListValue* args) OVERRIDE;
// Overridden from content::WebContentsDelegate.
virtual bool HandleContextMenu(
const content::ContextMenuParams& params) OVERRIDE;
base::WeakPtrFactory<InlineLoginHandlerImpl> weak_factory_; base::WeakPtrFactory<InlineLoginHandlerImpl> weak_factory_;
std::string email_; std::string email_;
std::string password_; std::string password_;
......
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