| 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/chromeos/ui/choose_mobile_network_dialog.h" | 5 #include "chrome/browser/chromeos/ui/choose_mobile_network_dialog.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" |
| 7 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
| 8 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
| 9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| 10 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
| 11 | 12 |
| 12 using content::WebContents; | 13 using content::WebContents; |
| 13 using content::WebUIMessageHandler; | 14 using content::WebUIMessageHandler; |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 // Default width/height of the dialog. | 18 // Default width/height of the dialog. |
| 18 const int kDefaultWidth = 350; | 19 const int kDefaultWidth = 350; |
| 19 const int kDefaultHeight = 225; | 20 const int kDefaultHeight = 225; |
| 20 | 21 |
| 21 } // namespace | 22 } // namespace |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace chromeos { |
| 24 | 25 |
| 25 // static | 26 // static |
| 26 void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow owning_window) { | 27 void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow parent) { |
| 27 chrome::ShowWebDialog(owning_window, | 28 chrome::ShowWebDialog(parent, ProfileManager::GetActiveUserProfile(), |
| 28 ProfileManager::GetActiveUserProfile(), | |
| 29 new ChooseMobileNetworkDialog); | 29 new ChooseMobileNetworkDialog); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // static |
| 33 void ChooseMobileNetworkDialog::ShowDialogInContainer(int container_id) { |
| 34 // Dialog should be in a modal window container. |
| 35 DCHECK(container_id == ash::kShellWindowId_SystemModalContainer || |
| 36 container_id == ash::kShellWindowId_LockSystemModalContainer); |
| 37 chrome::ShowWebDialogInContainer(container_id, |
| 38 ProfileManager::GetActiveUserProfile(), |
| 39 new ChooseMobileNetworkDialog); |
| 40 } |
| 41 |
| 32 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() { | 42 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() { |
| 33 } | 43 } |
| 34 | 44 |
| 35 ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { | 45 ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { |
| 36 return ui::MODAL_TYPE_SYSTEM; | 46 return ui::MODAL_TYPE_SYSTEM; |
| 37 } | 47 } |
| 38 | 48 |
| 39 base::string16 ChooseMobileNetworkDialog::GetDialogTitle() const { | 49 base::string16 ChooseMobileNetworkDialog::GetDialogTitle() const { |
| 40 return base::string16(); | 50 return base::string16(); |
| 41 } | 51 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 69 return false; | 79 return false; |
| 70 } | 80 } |
| 71 | 81 |
| 72 bool ChooseMobileNetworkDialog::HandleContextMenu( | 82 bool ChooseMobileNetworkDialog::HandleContextMenu( |
| 73 const content::ContextMenuParams& params) { | 83 const content::ContextMenuParams& params) { |
| 74 // Disable context menu. | 84 // Disable context menu. |
| 75 return true; | 85 return true; |
| 76 } | 86 } |
| 77 | 87 |
| 78 } // namespace chromeos | 88 } // namespace chromeos |
| OLD | NEW |