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/sim_dialog_delegate.h" | 5 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "chrome/browser/chromeos/login/user_manager.h" | 8 #include "chrome/browser/chromeos/login/user_manager.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 const char kSimDialogSetLockOnMode[] = "set-lock-on"; | 40 const char kSimDialogSetLockOnMode[] = "set-lock-on"; |
41 const char kSimDialogSetLockOffMode[] = "set-lock-off"; | 41 const char kSimDialogSetLockOffMode[] = "set-lock-off"; |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 namespace chromeos { | 45 namespace chromeos { |
46 | 46 |
47 // static | 47 // static |
48 void SimDialogDelegate::ShowDialog(gfx::NativeWindow owning_window, | 48 void SimDialogDelegate::ShowDialog(gfx::NativeWindow owning_window, |
49 SimDialogMode mode) { | 49 SimDialogMode mode) { |
50 views::Widget::CreateWindowWithParent( | 50 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
51 new HtmlDialogView(ProfileManager::GetDefaultProfileOrOffTheRecord(), | 51 HtmlDialogView* html_view = |
| 52 new HtmlDialogView(profile, |
52 BrowserList::GetLastActive(), | 53 BrowserList::GetLastActive(), |
53 new SimDialogDelegate(mode)), | 54 new SimDialogDelegate(mode)); |
54 owning_window)->Show(); | 55 html_view->InitDialog(); |
| 56 views::Widget::CreateWindowWithParent(html_view, owning_window); |
| 57 html_view->GetWidget()->Show(); |
55 } | 58 } |
56 | 59 |
57 SimDialogDelegate::SimDialogDelegate(SimDialogMode dialog_mode) | 60 SimDialogDelegate::SimDialogDelegate(SimDialogMode dialog_mode) |
58 : dialog_mode_(dialog_mode) { | 61 : dialog_mode_(dialog_mode) { |
59 } | 62 } |
60 | 63 |
61 SimDialogDelegate::~SimDialogDelegate() { | 64 SimDialogDelegate::~SimDialogDelegate() { |
62 } | 65 } |
63 | 66 |
64 ui::ModalType SimDialogDelegate::GetDialogModalType() const { | 67 ui::ModalType SimDialogDelegate::GetDialogModalType() const { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return false; | 118 return false; |
116 } | 119 } |
117 | 120 |
118 bool SimDialogDelegate::HandleContextMenu( | 121 bool SimDialogDelegate::HandleContextMenu( |
119 const content::ContextMenuParams& params) { | 122 const content::ContextMenuParams& params) { |
120 // Disable context menu. | 123 // Disable context menu. |
121 return true; | 124 return true; |
122 } | 125 } |
123 | 126 |
124 } // namespace chromeos | 127 } // namespace chromeos |
OLD | NEW |