summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/sync/inline_login_dialog.cc
blob: 2840f10a4c526e159075e84fcbc37b778f515e3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/sync/inline_login_dialog.h"

#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/url_constants.h"
#include "ui/gfx/size.h"
#include "url/gurl.h"

// static
void InlineLoginDialog::Show(Profile* profile) {
  chrome::ShowWebDialog(NULL, profile, new InlineLoginDialog(profile));
}

InlineLoginDialog::InlineLoginDialog(Profile* profile)
    : profile_(profile) {
}

ui::ModalType InlineLoginDialog::GetDialogModalType() const {
  return ui::MODAL_TYPE_SYSTEM;
}

base::string16 InlineLoginDialog::GetDialogTitle() const {
  return base::string16();
}

GURL InlineLoginDialog::GetDialogContentURL() const {
  return GURL(chrome::kChromeUIChromeSigninURL);
}

void InlineLoginDialog::GetWebUIMessageHandlers(
    std::vector<content::WebUIMessageHandler*>* handlers) const {
}

void InlineLoginDialog::GetDialogSize(gfx::Size* size) const {
  size->SetSize(380, 290);
}

std::string InlineLoginDialog::GetDialogArgs() const {
  return "[]";
}

void InlineLoginDialog::OnDialogClosed(const std::string& json_retval) {
  delete this;
}

void InlineLoginDialog::OnCloseContents(
    content::WebContents* source, bool* out_close_dialog) {
  if (out_close_dialog)
    *out_close_dialog = true;
}

bool InlineLoginDialog::ShouldShowDialogTitle() const {
  return false;
}

bool InlineLoginDialog::HandleContextMenu(
    const content::ContextMenuParams& params) {
  return true;
}