Index: chrome/browser/ui/views/try_chrome_dialog_view.h |
diff --git a/chrome/browser/first_run/try_chrome_dialog_view.h b/chrome/browser/ui/views/try_chrome_dialog_view.h |
similarity index 84% |
rename from chrome/browser/first_run/try_chrome_dialog_view.h |
rename to chrome/browser/ui/views/try_chrome_dialog_view.h |
index 897b73dbd6bb8b60c7faff2e248597cb698a5c13..9f9387082489567d4ec1dba91f01a01b8e5566d3 100644 |
--- a/chrome/browser/first_run/try_chrome_dialog_view.h |
+++ b/chrome/browser/ui/views/try_chrome_dialog_view.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ |
-#define CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ |
+#ifndef CHROME_BROWSER_UI_VIEWS_TRY_CHROME_DIALOG_VIEW_H_ |
+#define CHROME_BROWSER_UI_VIEWS_TRY_CHROME_DIALOG_VIEW_H_ |
#include <stddef.h> |
@@ -79,13 +79,33 @@ class TryChromeDialogView : public views::ButtonListener, |
// Note that the dialog has no parent and it will position itself in a lower |
// corner of the screen. The dialog does not steal focus and does not have an |
// entry in the taskbar. |
- static Result Show(size_t flavor, const ActiveModalDialogListener& listener); |
- |
+ static Result Show(size_t flavor, |
+ const ActiveModalDialogListener& listener); |
private: |
+ // Indicates whether the dialog is modal |
+ enum DialogType { |
sky
2017/04/28 21:25:49
Use enum class. Also, we have moved to kFoo for en
ananta
2017/04/28 21:45:22
Done.
|
+ MODAL, // Modal dialog. |
+ MODELESS, // Modeless dialog. |
+ }; |
+ |
+ // Indicates the usage type. Chrome or tests. |
+ enum UsageType { |
+ FOR_CHROME, |
+ FOR_TESTING, |
+ }; |
+ |
+ friend class TryChromeDialogTest; |
+ |
explicit TryChromeDialogView(size_t flavor); |
~TryChromeDialogView() override; |
- Result ShowModal(const ActiveModalDialogListener& listener); |
+ // Helper function to show the dialog. |
+ // The |dialog_type| parameter indicates whether the dialog is modal. |
+ // The |usage_type| parameter indicates whether this is being invoked by |
+ // chrome or a test. |
+ Result ShowDialog(const ActiveModalDialogListener& listener, |
+ DialogType dialog_type, |
+ UsageType usage_type); |
// Returns a screen rectangle that is fit to show the window. In particular |
// it has the following properties: a) is visible and b) is attached to the |
@@ -123,4 +143,4 @@ class TryChromeDialogView : public views::ButtonListener, |
DISALLOW_COPY_AND_ASSIGN(TryChromeDialogView); |
}; |
-#endif // CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ |
+#endif // CHROME_BROWSER_UI_VIEWS_TRY_CHROME_DIALOG_VIEW_H_ |