OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ui/views/first_run_dialog.h" | 5 #include "chrome/browser/ui/views/first_run_dialog.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/first_run/first_run.h" | 9 #include "chrome/browser/first_run/first_run.h" |
10 #include "chrome/browser/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 quit_runloop_.Run(); | 104 quit_runloop_.Run(); |
105 } | 105 } |
106 | 106 |
107 views::View* FirstRunDialog::CreateExtraView() { | 107 views::View* FirstRunDialog::CreateExtraView() { |
108 views::Link* link = new views::Link(l10n_util::GetStringUTF16( | 108 views::Link* link = new views::Link(l10n_util::GetStringUTF16( |
109 IDS_LEARN_MORE)); | 109 IDS_LEARN_MORE)); |
110 link->set_listener(this); | 110 link->set_listener(this); |
111 return link; | 111 return link; |
112 } | 112 } |
113 | 113 |
114 void FirstRunDialog::OnClosed() { | |
115 first_run::SetShouldShowWelcomePage(); | |
116 Done(); | |
117 } | |
118 | |
119 bool FirstRunDialog::Accept() { | 114 bool FirstRunDialog::Accept() { |
120 GetWidget()->Hide(); | 115 GetWidget()->Hide(); |
121 | 116 |
122 if (report_crashes_ && report_crashes_->checked()) { | 117 if (report_crashes_ && report_crashes_->checked()) { |
123 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) | 118 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) |
124 breakpad::InitCrashReporter(std::string()); | 119 breakpad::InitCrashReporter(std::string()); |
125 } else { | 120 } else { |
126 GoogleUpdateSettings::SetCollectStatsConsent(false); | 121 GoogleUpdateSettings::SetCollectStatsConsent(false); |
127 } | 122 } |
128 | 123 |
129 if (make_default_ && make_default_->checked()) | 124 if (make_default_ && make_default_->checked()) |
130 shell_integration::SetAsDefaultBrowser(); | 125 shell_integration::SetAsDefaultBrowser(); |
131 | 126 |
132 Done(); | 127 Done(); |
133 return true; | 128 return true; |
134 } | 129 } |
135 | 130 |
136 int FirstRunDialog::GetDialogButtons() const { | 131 int FirstRunDialog::GetDialogButtons() const { |
137 return ui::DIALOG_BUTTON_OK; | 132 return ui::DIALOG_BUTTON_OK; |
138 } | 133 } |
139 | 134 |
| 135 void FirstRunDialog::WindowClosing() { |
| 136 first_run::SetShouldShowWelcomePage(); |
| 137 Done(); |
| 138 } |
| 139 |
140 void FirstRunDialog::LinkClicked(views::Link* source, int event_flags) { | 140 void FirstRunDialog::LinkClicked(views::Link* source, int event_flags) { |
141 platform_util::OpenExternal(profile_, GURL(chrome::kLearnMoreReportingURL)); | 141 platform_util::OpenExternal(profile_, GURL(chrome::kLearnMoreReportingURL)); |
142 } | 142 } |
OLD | NEW |