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

Unified Diff: chrome/browser/ui/views/try_chrome_dialog_view.h

Issue 2816293002: Description: Replace layout constants in chrome/browser/extensions and chrome/browser/first_run (Closed)
Patch Set: Enable the TryChromeDialogTest.InvokeDialog_default test. The TryChromeDialogTest is now a friend o… Created 3 years, 8 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/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_

Powered by Google App Engine
This is Rietveld 408576698