process_singleton_dialog_linux.cc revision a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7
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/process_singleton_dialog_linux.h"
6
7#include "base/run_loop.h"
8#include "chrome/browser/ui/simple_message_box.h"
9#include "grit/chromium_strings.h"
10#include "grit/generated_resources.h"
11#include "ui/base/l10n/l10n_util.h"
12
13bool ShowProcessSingletonDialog(const base::string16& message,
14                                const base::string16& relaunch_text) {
15  bool result = chrome::ShowMessageBoxWithButtonText(
16                    NULL,
17                    l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
18                    message,
19                    relaunch_text,
20                    l10n_util::GetStringUTF16(IDS_PROFILE_IN_USE_LINUX_QUIT)) ==
21                chrome::MESSAGE_BOX_RESULT_YES;
22
23  // Avoids gpu_process_transport_factory.cc(153)] Check failed:
24  // per_compositor_data_.empty() when quit is chosen.
25  base::RunLoop().RunUntilIdle();
26
27  return result;
28}
29