| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 views::View* FirstRunDialog::CreateExtraView() { | 109 views::View* FirstRunDialog::CreateExtraView() { |
| 110 views::Link* link = new views::Link(l10n_util::GetStringUTF16( | 110 views::Link* link = new views::Link(l10n_util::GetStringUTF16( |
| 111 IDS_LEARN_MORE)); | 111 IDS_LEARN_MORE)); |
| 112 link->set_listener(this); | 112 link->set_listener(this); |
| 113 return link; | 113 return link; |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool FirstRunDialog::Accept() { | 116 bool FirstRunDialog::Accept() { |
| 117 GetWidget()->Hide(); | 117 GetWidget()->Hide(); |
| 118 | 118 |
| 119 InitiateMetricsReportingChange(report_crashes_->checked(), | 119 ChangeMetricsReportingStateWithReply(report_crashes_->checked(), |
| 120 base::Bind(&InitCrashReporterIfEnabled)); | 120 base::Bind(&InitCrashReporterIfEnabled)); |
| 121 | 121 |
| 122 if (make_default_->checked()) | 122 if (make_default_->checked()) |
| 123 shell_integration::SetAsDefaultBrowser(); | 123 shell_integration::SetAsDefaultBrowser(); |
| 124 | 124 |
| 125 Done(); | 125 Done(); |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 int FirstRunDialog::GetDialogButtons() const { | 129 int FirstRunDialog::GetDialogButtons() const { |
| 130 return ui::DIALOG_BUTTON_OK; | 130 return ui::DIALOG_BUTTON_OK; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void FirstRunDialog::WindowClosing() { | 133 void FirstRunDialog::WindowClosing() { |
| 134 first_run::SetShouldShowWelcomePage(); | 134 first_run::SetShouldShowWelcomePage(); |
| 135 Done(); | 135 Done(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void FirstRunDialog::LinkClicked(views::Link* source, int event_flags) { | 138 void FirstRunDialog::LinkClicked(views::Link* source, int event_flags) { |
| 139 platform_util::OpenExternal(profile_, GURL(chrome::kLearnMoreReportingURL)); | 139 platform_util::OpenExternal(profile_, GURL(chrome::kLearnMoreReportingURL)); |
| 140 } | 140 } |
| OLD | NEW |