Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ |
| 6 #define CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
| 14 #include "ui/views/controls/link_listener.h" | 14 #include "ui/views/controls/link_listener.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
|
huangs
2017/03/13 15:29:28
Probably should include; please see below.
grt (UTC plus 2)
2017/03/14 09:24:17
Done.
| |
| 17 class Rect; | 17 class Rect; |
| 18 class Size; | |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace views { | 21 namespace views { |
| 21 class RadioButton; | 22 class RadioButton; |
| 22 class Checkbox; | 23 class Checkbox; |
| 23 class Widget; | 24 class Widget; |
| 24 } | 25 } |
| 25 | 26 |
| 26 // This class displays a modal dialog using the views system. The dialog asks | 27 // This class displays a modal dialog using the views system. The dialog asks |
| 27 // the user to give chrome another try. This class only handles the UI so the | 28 // the user to give chrome another try. This class only handles the UI so the |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 private: | 87 private: |
| 87 explicit TryChromeDialogView(size_t flavor); | 88 explicit TryChromeDialogView(size_t flavor); |
| 88 ~TryChromeDialogView() override; | 89 ~TryChromeDialogView() override; |
| 89 | 90 |
| 90 Result ShowModal(const ActiveModalDialogListener& listener); | 91 Result ShowModal(const ActiveModalDialogListener& listener); |
| 91 | 92 |
| 92 // Returns a screen rectangle that is fit to show the window. In particular | 93 // Returns a screen rectangle that is fit to show the window. In particular |
| 93 // it has the following properties: a) is visible and b) is attached to the | 94 // it has the following properties: a) is visible and b) is attached to the |
| 94 // bottom of the working area. For LTR machines it returns a left side | 95 // bottom of the working area. For LTR machines it returns a left side |
| 95 // rectangle and for RTL it returns a right side rectangle so that the dialog | 96 // rectangle and for RTL it returns a right side rectangle so that the dialog |
| 96 // does not compete with the standar place of the start menu. | 97 // does not compete with the standard place of the start menu. |
| 97 gfx::Rect ComputeWindowPosition(int width, int height, bool is_RTL); | 98 gfx::Rect ComputeWindowPosition(gfx::Size size, bool is_RTL); |
|
huangs
2017/03/13 15:29:28
gfx::Rect and gfx::Size are returned / passed by v
grt (UTC plus 2)
2017/03/14 09:24:17
Done.
| |
| 98 | 99 |
| 99 // Create a windows region that looks like a toast of width |w| and height | 100 // Create a windows region that looks like a toast of width |w| and height |
| 100 // |h|. This is best effort, so we don't care much if the operation fails. | 101 // |h|. This is best effort, so we don't care much if the operation fails. |
| 101 void SetToastRegion(HWND window, int w, int h); | 102 void SetToastRegion(HWND window, int w, int h); |
| 102 | 103 |
| 103 // views::ButtonListener: | 104 // views::ButtonListener: |
| 104 // We have two buttons and according to what the user clicked we set |result_| | 105 // We have two buttons and according to what the user clicked we set |result_| |
| 105 // and we should always close and end the modal loop. | 106 // and we should always close and end the modal loop. |
| 106 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 107 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 107 | 108 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 119 views::RadioButton* try_chrome_; | 120 views::RadioButton* try_chrome_; |
| 120 views::RadioButton* kill_chrome_; | 121 views::RadioButton* kill_chrome_; |
| 121 views::RadioButton* dont_try_chrome_; | 122 views::RadioButton* dont_try_chrome_; |
| 122 views::Checkbox* make_default_; | 123 views::Checkbox* make_default_; |
| 123 Result result_; | 124 Result result_; |
| 124 | 125 |
| 125 DISALLOW_COPY_AND_ASSIGN(TryChromeDialogView); | 126 DISALLOW_COPY_AND_ASSIGN(TryChromeDialogView); |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 #endif // CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ | 129 #endif // CHROME_BROWSER_FIRST_RUN_TRY_CHROME_DIALOG_VIEW_H_ |
| OLD | NEW |