| 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 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 50 views::Widget::CreateWindowWithParent( |
| 51 HtmlDialogView* html_view = | 51 new HtmlDialogView(ProfileManager::GetDefaultProfileOrOffTheRecord(), |
| 52 new HtmlDialogView(profile, | |
| 53 BrowserList::GetLastActive(), | 52 BrowserList::GetLastActive(), |
| 54 new SimDialogDelegate(mode)); | 53 new SimDialogDelegate(mode)), |
| 55 html_view->InitDialog(); | 54 owning_window)->Show(); |
| 56 views::Widget::CreateWindowWithParent(html_view, owning_window); | |
| 57 html_view->GetWidget()->Show(); | |
| 58 } | 55 } |
| 59 | 56 |
| 60 SimDialogDelegate::SimDialogDelegate(SimDialogMode dialog_mode) | 57 SimDialogDelegate::SimDialogDelegate(SimDialogMode dialog_mode) |
| 61 : dialog_mode_(dialog_mode) { | 58 : dialog_mode_(dialog_mode) { |
| 62 } | 59 } |
| 63 | 60 |
| 64 SimDialogDelegate::~SimDialogDelegate() { | 61 SimDialogDelegate::~SimDialogDelegate() { |
| 65 } | 62 } |
| 66 | 63 |
| 67 ui::ModalType SimDialogDelegate::GetDialogModalType() const { | 64 ui::ModalType SimDialogDelegate::GetDialogModalType() const { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return false; | 115 return false; |
| 119 } | 116 } |
| 120 | 117 |
| 121 bool SimDialogDelegate::HandleContextMenu( | 118 bool SimDialogDelegate::HandleContextMenu( |
| 122 const content::ContextMenuParams& params) { | 119 const content::ContextMenuParams& params) { |
| 123 // Disable context menu. | 120 // Disable context menu. |
| 124 return true; | 121 return true; |
| 125 } | 122 } |
| 126 | 123 |
| 127 } // namespace chromeos | 124 } // namespace chromeos |
| OLD | NEW |