OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/charger_replace/charger_link_dialog.h" | 5 #include "chrome/browser/chromeos/charger_replace/charger_link_dialog.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 ChargerLinkDialog::ChargerLinkDialog(gfx::NativeWindow parent_window, | 31 ChargerLinkDialog::ChargerLinkDialog(gfx::NativeWindow parent_window, |
32 std::string url) | 32 std::string url) |
33 : parent_window_(parent_window), | 33 : parent_window_(parent_window), |
34 url_(url) { | 34 url_(url) { |
35 } | 35 } |
36 | 36 |
37 ChargerLinkDialog::~ChargerLinkDialog() { | 37 ChargerLinkDialog::~ChargerLinkDialog() { |
38 } | 38 } |
39 | 39 |
40 void ChargerLinkDialog::Show() { | 40 void ChargerLinkDialog::Show() { |
| 41 // We show the dialog for the active user, so that the dialog will get |
| 42 // displayed immediately. The parent window is a system modal/lock container |
| 43 // and does not belong to any user. |
41 chrome::ShowWebDialog(parent_window_, | 44 chrome::ShowWebDialog(parent_window_, |
42 ProfileManager::GetDefaultProfile(), | 45 ProfileManager::GetActiveUserProfile(), |
43 this); | 46 this); |
44 } | 47 } |
45 | 48 |
46 ui::ModalType ChargerLinkDialog::GetDialogModalType() const { | 49 ui::ModalType ChargerLinkDialog::GetDialogModalType() const { |
47 return ui::MODAL_TYPE_SYSTEM; | 50 return ui::MODAL_TYPE_SYSTEM; |
48 } | 51 } |
49 | 52 |
50 base::string16 ChargerLinkDialog::GetDialogTitle() const { | 53 base::string16 ChargerLinkDialog::GetDialogTitle() const { |
51 return l10n_util::GetStringUTF16(IDS_CHARGER_REPLACEMENT_DIALOG_TITLE); | 54 return l10n_util::GetStringUTF16(IDS_CHARGER_REPLACEMENT_DIALOG_TITLE); |
52 } | 55 } |
(...skipping 28 matching lines...) Expand all Loading... |
81 return true; | 84 return true; |
82 } | 85 } |
83 | 86 |
84 bool ChargerLinkDialog::HandleContextMenu( | 87 bool ChargerLinkDialog::HandleContextMenu( |
85 const content::ContextMenuParams& params) { | 88 const content::ContextMenuParams& params) { |
86 // Disable context menu. | 89 // Disable context menu. |
87 return true; | 90 return true; |
88 } | 91 } |
89 | 92 |
90 } // namespace chromeos | 93 } // namespace chromeos |
OLD | NEW |