summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/sync/inline_login_dialog.cc
blob: 73c9eebc1602bf01a6457a32c549b1af1b9504dd (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;
}

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

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

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;
}