Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3946)

Unified Diff: chrome/browser/ui/screen_capture_confirmation_dialog.cc

Issue 12843009: Replace screen capture confirmation infobar with a message box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/screen_capture_confirmation_dialog.cc
diff --git a/chrome/browser/ui/screen_capture_confirmation_dialog.cc b/chrome/browser/ui/screen_capture_confirmation_dialog.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fa0f41be440b101a3fd1e2b294493538cdd8dacc
--- /dev/null
+++ b/chrome/browser/ui/screen_capture_confirmation_dialog.cc
@@ -0,0 +1,43 @@
+// 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/screen_capture_confirmation_dialog.h"
+
+#include "base/logging.h"
+#include "chrome/browser/ui/simple_message_box.h"
+#include "content/public/browser/browser_thread.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+ScreenCaptureConfirmationDialog::ScreenCaptureConfirmationDialog()
+ : weak_factory_(this) {
+}
+
+ScreenCaptureConfirmationDialog::~ScreenCaptureConfirmationDialog() {
+}
+
+bool ScreenCaptureConfirmationDialog::Show(
+ const ResultCallback& result_callback,
+ const string16& application_name) {
+ result_callback_ = result_callback;
+ application_name_ = application_name;
Peter Kasting 2013/03/22 22:48:30 If you pass these to ShowMessageBox(), you need no
Sergey Ulanov 2013/03/22 23:26:09 Done.
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&ScreenCaptureConfirmationDialog::ShowMessageBox,
+ weak_factory_.GetWeakPtr()));
+ return true;
+}
+
+void ScreenCaptureConfirmationDialog::ShowMessageBox() {
+ chrome::MessageBoxResult result = chrome::ShowMessageBox(
+ NULL,
+ l10n_util::GetStringFUTF16(IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TITLE,
+ application_name_),
+ l10n_util::GetStringFUTF16(IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TEXT,
+ application_name_),
+ chrome::MESSAGE_BOX_TYPE_QUESTION);
+ ResultCallback callback = result_callback_;
+ result_callback_.Reset();
+ callback.Run(result == chrome::MESSAGE_BOX_RESULT_YES ? ALLOW : DENY);
+}
« no previous file with comments | « chrome/browser/ui/screen_capture_confirmation_dialog.h ('k') | chrome/browser/ui/screen_capture_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698