Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/browser/chromeos/charger_replace/charger_replacement_dialog.cc

Issue 128583002: Removal of GetDefaultProfile for new charger messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/charger_replace/charger_replacement_dialog.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_replacement_dialog.h" 5 #include "chrome/browser/chromeos/charger_replace/charger_replacement_dialog.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/browser_dialogs.h" 10 #include "chrome/browser/ui/browser_dialogs.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void ChargerReplacementDialog::SetFocusOnChargerDialogIfVisible() { 66 void ChargerReplacementDialog::SetFocusOnChargerDialogIfVisible() {
67 if (is_window_visible_ && current_window_) 67 if (is_window_visible_ && current_window_)
68 current_window_->Focus(); 68 current_window_->Focus();
69 } 69 }
70 70
71 void ChargerReplacementDialog::Show() { 71 void ChargerReplacementDialog::Show() {
72 content::RecordAction( 72 content::RecordAction(
73 content::UserMetricsAction("ShowChargerReplacementDialog")); 73 content::UserMetricsAction("ShowChargerReplacementDialog"));
74 74
75 is_window_visible_ = true; 75 is_window_visible_ = true;
76 current_window_ = chrome::ShowWebDialog(parent_window_, 76 // We show the dialog for the active user, so that the dialog will get
77 ProfileManager::GetDefaultProfile(), 77 // displayed immediately. The parent window is a system modal/lock container
78 this); 78 // and does not belong to any user.
79 current_window_ = chrome::ShowWebDialog(
80 parent_window_,
81 ProfileManager::GetActiveUserProfile(),
82 this);
jennyz 2014/01/08 18:43:03 Will ProfileManager::GetActiveUserProfile() replac
Mr4D (OOO till 08-26) 2014/01/08 18:58:28 Yes. It does the same logic as the old "GetDefault
79 charger_replacement_handler_->set_charger_window(current_window_); 83 charger_replacement_handler_->set_charger_window(current_window_);
80 } 84 }
81 85
82 ui::ModalType ChargerReplacementDialog::GetDialogModalType() const { 86 ui::ModalType ChargerReplacementDialog::GetDialogModalType() const {
83 return ui::MODAL_TYPE_SYSTEM; 87 return ui::MODAL_TYPE_SYSTEM;
84 } 88 }
85 89
86 base::string16 ChargerReplacementDialog::GetDialogTitle() const { 90 base::string16 ChargerReplacementDialog::GetDialogTitle() const {
87 return l10n_util::GetStringUTF16(IDS_CHARGER_REPLACEMENT_DIALOG_TITLE); 91 return l10n_util::GetStringUTF16(IDS_CHARGER_REPLACEMENT_DIALOG_TITLE);
88 } 92 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return true; 139 return true;
136 } 140 }
137 141
138 bool ChargerReplacementDialog::HandleContextMenu( 142 bool ChargerReplacementDialog::HandleContextMenu(
139 const content::ContextMenuParams& params) { 143 const content::ContextMenuParams& params) {
140 // Disable context menu. 144 // Disable context menu.
141 return true; 145 return true;
142 } 146 }
143 147
144 } // namespace chromeos 148 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/charger_replace/charger_replacement_dialog.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698