1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/ui/sync/inline_login_dialog.h" 6 7 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/ui/browser_dialogs.h" 9 #include "chrome/common/url_constants.h" 10 #include "ui/gfx/size.h" 11 #include "url/gurl.h" 12 13 // static Show(Profile * profile)14void InlineLoginDialog::Show(Profile* profile) { 15 chrome::ShowWebDialog(NULL, profile, new InlineLoginDialog(profile)); 16 } 17 InlineLoginDialog(Profile * profile)18InlineLoginDialog::InlineLoginDialog(Profile* profile) 19 : profile_(profile) { 20 } 21 GetDialogModalType() const22ui::ModalType InlineLoginDialog::GetDialogModalType() const { 23 return ui::MODAL_TYPE_SYSTEM; 24 } 25 GetDialogTitle() const26base::string16 InlineLoginDialog::GetDialogTitle() const { 27 return base::string16(); 28 } 29 GetDialogContentURL() const30GURL InlineLoginDialog::GetDialogContentURL() const { 31 return GURL(chrome::kChromeUIChromeSigninURL); 32 } 33 GetWebUIMessageHandlers(std::vector<content::WebUIMessageHandler * > * handlers) const34void InlineLoginDialog::GetWebUIMessageHandlers( 35 std::vector<content::WebUIMessageHandler*>* handlers) const { 36 } 37 GetDialogSize(gfx::Size * size) const38void InlineLoginDialog::GetDialogSize(gfx::Size* size) const { 39 size->SetSize(380, 290); 40 } 41 GetDialogArgs() const42std::string InlineLoginDialog::GetDialogArgs() const { 43 return "[]"; 44 } 45 OnDialogClosed(const std::string & json_retval)46void InlineLoginDialog::OnDialogClosed(const std::string& json_retval) { 47 delete this; 48 } 49 OnCloseContents(content::WebContents * source,bool * out_close_dialog)50void InlineLoginDialog::OnCloseContents( 51 content::WebContents* source, bool* out_close_dialog) { 52 if (out_close_dialog) 53 *out_close_dialog = true; 54 } 55 ShouldShowDialogTitle() const56bool InlineLoginDialog::ShouldShowDialogTitle() const { 57 return false; 58 } 59 HandleContextMenu(const content::ContextMenuParams & params)60bool InlineLoginDialog::HandleContextMenu( 61 const content::ContextMenuParams& params) { 62 return true; 63 } 64