summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_modal_dialog_gtk.cc
blob: 2eb91854474dc5740ccb2504a822365b614ee08e (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
// Copyright (c) 2009 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/app_modal_dialog.h"

#include <gtk/gtk.h>

#include "app/l10n_util.h"
#include "app/message_box_flags.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"

AppModalDialog::~AppModalDialog() {
}

void AppModalDialog::CreateAndShowDialog() {
}

// static
void AppModalDialog::OnDialogResponse(GtkDialog* dialog, gint response_id,
                                      AppModalDialog* app_modal_dialog) {
  app_modal_dialog->HandleDialogResponse(dialog, response_id);
}

void AppModalDialog::ActivateModalDialog() {
  DCHECK(dialog_);
  gtk_window_present(GTK_WINDOW(dialog_));
}

void AppModalDialog::CloseModalDialog() {
  DCHECK(dialog_);
  HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT);
}

void AppModalDialog::AcceptWindow() {
  DCHECK(dialog_);
  HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_OK);
}

void AppModalDialog::CancelWindow() {
  DCHECK(dialog_);
  HandleDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_CANCEL);
}