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" |
(...skipping 10 matching lines...) Expand all Loading... |
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 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 31 views::Widget::CreateWindowWithParent( |
32 HtmlDialogView* html_view = | 32 new HtmlDialogView(ProfileManager::GetDefaultProfileOrOffTheRecord(), |
33 new HtmlDialogView(profile, | |
34 BrowserList::GetLastActive(), | 33 BrowserList::GetLastActive(), |
35 new ChooseMobileNetworkDialog); | 34 new ChooseMobileNetworkDialog), |
36 html_view->InitDialog(); | 35 owning_window)->Show(); |
37 views::Widget::CreateWindowWithParent(html_view, owning_window); | |
38 html_view->GetWidget()->Show(); | |
39 } | 36 } |
40 | 37 |
41 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() { | 38 ChooseMobileNetworkDialog::ChooseMobileNetworkDialog() { |
42 } | 39 } |
43 | 40 |
44 ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { | 41 ui::ModalType ChooseMobileNetworkDialog::GetDialogModalType() const { |
45 return ui::MODAL_TYPE_SYSTEM; | 42 return ui::MODAL_TYPE_SYSTEM; |
46 } | 43 } |
47 | 44 |
48 string16 ChooseMobileNetworkDialog::GetDialogTitle() const { | 45 string16 ChooseMobileNetworkDialog::GetDialogTitle() const { |
(...skipping 30 matching lines...) Expand all Loading... |
79 return false; | 76 return false; |
80 } | 77 } |
81 | 78 |
82 bool ChooseMobileNetworkDialog::HandleContextMenu( | 79 bool ChooseMobileNetworkDialog::HandleContextMenu( |
83 const content::ContextMenuParams& params) { | 80 const content::ContextMenuParams& params) { |
84 // Disable context menu. | 81 // Disable context menu. |
85 return true; | 82 return true; |
86 } | 83 } |
87 | 84 |
88 } // namespace chromeos | 85 } // namespace chromeos |
OLD | NEW |