Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/chromeos/mobile_setup_dialog.h" | 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/browser_shutdown.h" | 11 #include "chrome/browser/browser_shutdown.h" |
| 12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 12 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 14 #include "chrome/browser/chromeos/mobile/mobile_activator.h" | 14 #include "chrome/browser/chromeos/mobile/mobile_activator.h" |
| 15 #include "chrome/browser/platform_util.h" | 15 #include "chrome/browser/platform_util.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/ui/browser_dialogs.h" | 17 #include "chrome/browser/ui/browser_dialogs.h" |
| 18 #include "chrome/browser/ui/simple_message_box.h" | 18 #include "chrome/browser/ui/simple_message_box.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 | 77 |
| 78 MobileSetupDialogDelegate::MobileSetupDialogDelegate() : dialog_window_(NULL) { | 78 MobileSetupDialogDelegate::MobileSetupDialogDelegate() : dialog_window_(NULL) { |
| 79 } | 79 } |
| 80 | 80 |
| 81 MobileSetupDialogDelegate::~MobileSetupDialogDelegate() { | 81 MobileSetupDialogDelegate::~MobileSetupDialogDelegate() { |
| 82 } | 82 } |
| 83 | 83 |
| 84 void MobileSetupDialogDelegate::ShowDialog(const std::string& service_path) { | 84 void MobileSetupDialogDelegate::ShowDialog(const std::string& service_path) { |
| 85 service_path_ = service_path; | 85 service_path_ = service_path; |
| 86 | 86 |
| 87 gfx::NativeWindow parent = NULL; | 87 gfx::NativeWindow parent = NULL; |
|
achuithb
2016/01/21 23:14:31
nullptr since you're here
jdufault
2016/01/22 21:14:11
Done.
| |
| 88 // If we're on the login screen. | 88 // If we're on the login screen. |
| 89 if (chromeos::LoginDisplayHostImpl::default_host()) { | 89 if (chromeos::LoginDisplayHost::default_host()) { |
| 90 chromeos::LoginDisplayHostImpl* webui_host = | 90 chromeos::WebUILoginView* login_view = |
| 91 static_cast<chromeos::LoginDisplayHostImpl*>( | 91 chromeos::LoginDisplayHost::default_host()->GetWebUILoginView(); |
| 92 chromeos::LoginDisplayHostImpl::default_host()); | |
| 93 chromeos::WebUILoginView* login_view = webui_host->GetWebUILoginView(); | |
| 94 if (login_view) | 92 if (login_view) |
| 95 parent = login_view->GetNativeWindow(); | 93 parent = login_view->GetNativeWindow(); |
| 96 } | 94 } |
| 97 // Only the primary user can change this. | 95 // Only the primary user can change this. |
| 98 dialog_window_ = chrome::ShowWebDialog( | 96 dialog_window_ = chrome::ShowWebDialog( |
| 99 parent, | 97 parent, |
| 100 ProfileManager::GetPrimaryUserProfile(), | 98 ProfileManager::GetPrimaryUserProfile(), |
| 101 this); | 99 this); |
| 102 } | 100 } |
| 103 | 101 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 } | 149 } |
| 152 | 150 |
| 153 bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const { | 151 bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const { |
| 154 return true; | 152 return true; |
| 155 } | 153 } |
| 156 | 154 |
| 157 bool MobileSetupDialogDelegate::HandleContextMenu( | 155 bool MobileSetupDialogDelegate::HandleContextMenu( |
| 158 const content::ContextMenuParams& params) { | 156 const content::ContextMenuParams& params) { |
| 159 return true; | 157 return true; |
| 160 } | 158 } |
| OLD | NEW |