| 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/chromeos/choose_mobile_network_dialog.h" | 5 #include "chrome/browser/chromeos/choose_mobile_network_dialog.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/login/user_manager.h" | 7 #include "chrome/browser/chromeos/login/user_manager.h" |
| 8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| 11 #include "chrome/browser/ui/views/html_dialog_view.h" | 11 #include "chrome/browser/ui/views/web_dialog_view.h" |
| 12 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
| 13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
| 15 | 15 |
| 16 using content::WebContents; | 16 using content::WebContents; |
| 17 using content::WebUIMessageHandler; | 17 using content::WebUIMessageHandler; |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Default width/height of the dialog. | 21 // Default width/height of the dialog. |
| 22 const int kDefaultWidth = 350; | 22 const int kDefaultWidth = 350; |
| 23 const int kDefaultHeight = 225; | 23 const int kDefaultHeight = 225; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 namespace chromeos { | 27 namespace chromeos { |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow owning_window) { | 30 void ChooseMobileNetworkDialog::ShowDialog(gfx::NativeWindow owning_window) { |
| 31 views::Widget::CreateWindowWithParent( | 31 views::Widget::CreateWindowWithParent( |
| 32 new HtmlDialogView(ProfileManager::GetDefaultProfileOrOffTheRecord(), | 32 new WebDialogView(ProfileManager::GetDefaultProfileOrOffTheRecord(), |
| 33 BrowserList::GetLastActive(), | 33 BrowserList::GetLastActive(), |
| 34 new ChooseMobileNetworkDialog), | 34 new ChooseMobileNetworkDialog), |
| 35 owning_window)->Show(); | 35 owning_window)->Show(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() { | 38 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() { |
| 39 } | 39 } |
| 40 | 40 |
| 41 ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { | 41 ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { |
| 42 return ui::MODAL_TYPE_SYSTEM; | 42 return ui::MODAL_TYPE_SYSTEM; |
| 43 } | 43 } |
| 44 | 44 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return false; | 76 return false; |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool ChooseMobileNetworkDialog::HandleContextMenu( | 79 bool ChooseMobileNetworkDialog::HandleContextMenu( |
| 80 const content::ContextMenuParams& params) { | 80 const content::ContextMenuParams& params) { |
| 81 // Disable context menu. | 81 // Disable context menu. |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace chromeos | 85 } // namespace chromeos |
| OLD | NEW |