| 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 "chrome/browser/first_run/first_run.h" | 7 #include "chrome/browser/first_run/first_run.h" |
| 8 #include "chrome/browser/platform_util.h" | 8 #include "chrome/browser/platform_util.h" |
| 9 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Use the widget's window itself so that the message loop | 59 // Use the widget's window itself so that the message loop |
| 60 // exists when the dialog is closed by some other means than | 60 // exists when the dialog is closed by some other means than |
| 61 // |Accept|. | 61 // |Accept|. |
| 62 // | 62 // |
| 63 // This is the same trick used in simple_message_box_views.cc, minus the | 63 // This is the same trick used in simple_message_box_views.cc, minus the |
| 64 // refcounting. | 64 // refcounting. |
| 65 aura::Window* anchor = dialog->GetWidget()->GetNativeWindow(); | 65 aura::Window* anchor = dialog->GetWidget()->GetNativeWindow(); |
| 66 aura::client::DispatcherClient* client = | 66 aura::client::DispatcherClient* client = |
| 67 aura::client::GetDispatcherClient(anchor->GetRootWindow()); | 67 aura::client::GetDispatcherClient(anchor->GetRootWindow()); |
| 68 client->RunWithDispatcher(dialog, anchor, true); | 68 client->RunWithDispatcher(dialog, anchor); |
| 69 dialog_shown = true; | 69 dialog_shown = true; |
| 70 } | 70 } |
| 71 #endif // defined(GOOGLE_CHROME_BUILD) | 71 #endif // defined(GOOGLE_CHROME_BUILD) |
| 72 | 72 |
| 73 return dialog_shown; | 73 return dialog_shown; |
| 74 } | 74 } |
| 75 | 75 |
| 76 FirstRunDialog::FirstRunDialog(Profile* profile) | 76 FirstRunDialog::FirstRunDialog(Profile* profile) |
| 77 : profile_(profile), | 77 : profile_(profile), |
| 78 make_default_(NULL), | 78 make_default_(NULL), |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 141 | 141 |
| 142 uint32_t FirstRunDialog::Dispatch(const base::NativeEvent& event) { | 142 uint32_t FirstRunDialog::Dispatch(const base::NativeEvent& event) { |
| 143 uint32_t action = POST_DISPATCH_PERFORM_DEFAULT; | 143 uint32_t action = POST_DISPATCH_PERFORM_DEFAULT; |
| 144 if (!should_show_dialog_) | 144 if (!should_show_dialog_) |
| 145 action |= POST_DISPATCH_QUIT_LOOP; | 145 action |= POST_DISPATCH_QUIT_LOOP; |
| 146 return action; | 146 return action; |
| 147 } | 147 } |
| OLD | NEW |