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

Unified Diff: ash/display/display_error_dialog.h

Issue 12209026: Fix the crash of DisplayErrorDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 10 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: ash/display/display_error_dialog.h
diff --git a/ash/display/display_error_dialog.h b/ash/display/display_error_dialog.h
index 370a647080a56ac05a72fd5aa24c1a6c39cb2433..cd7829ea7caf4e03fde14049eabfb76715d6088f 100644
--- a/ash/display/display_error_dialog.h
+++ b/ash/display/display_error_dialog.h
@@ -5,8 +5,10 @@
#ifndef ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_
#define ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_
+#include "ash/ash_export.h"
#include "ash/display/display_controller.h"
#include "base/compiler_specific.h"
+#include "base/gtest_prod_util.h"
#include "ui/views/window/dialog_delegate.h"
namespace aura {
@@ -27,13 +29,18 @@ namespace internal {
// Dialog used to show an error messages when unable to change the display
// configuration to mirroring.
-class DisplayErrorDialog : public views::DialogDelegateView,
- public ash::DisplayController::Observer {
+class ASH_EXPORT DisplayErrorDialog : public views::DialogDelegateView,
+ public ash::DisplayController::Observer {
public:
// Shows the error dialog.
static void ShowDialog();
private:
+ FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, Normal);
+ FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, CallTwice);
+ FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, SingleDisplay);
+ FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, DisplayDisconnected);
+
DisplayErrorDialog();
virtual ~DisplayErrorDialog();
@@ -49,6 +56,9 @@ class DisplayErrorDialog : public views::DialogDelegateView,
// ash::DisplayController::Observer overrides:
virtual void OnDisplayConfigurationChanging() OVERRIDE;
+ // Returns the pointer of the current instance of this dialog.
+ static DisplayErrorDialog* GetInstanceForTest();
+
views::Label* label_;
DISALLOW_COPY_AND_ASSIGN(DisplayErrorDialog);

Powered by Google App Engine
This is Rietveld 408576698