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/bluetooth/bluetooth_pairing_dialog.h" | 5 #include "chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // This block of code is almost the same as chrome::ShowWebDialogInContainer() | 60 // This block of code is almost the same as chrome::ShowWebDialogInContainer() |
61 // except we're creating a frameless window. | 61 // except we're creating a frameless window. |
62 views::Widget* widget = new views::Widget; // Owned by native widget | 62 views::Widget* widget = new views::Widget; // Owned by native widget |
63 views::WebDialogView* view = | 63 views::WebDialogView* view = |
64 new views::WebDialogView(ProfileManager::GetActiveUserProfile(), this, | 64 new views::WebDialogView(ProfileManager::GetActiveUserProfile(), this, |
65 new ChromeWebContentsHandler); | 65 new ChromeWebContentsHandler); |
66 views::Widget::InitParams params( | 66 views::Widget::InitParams params( |
67 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 67 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
68 params.delegate = view; | 68 params.delegate = view; |
69 if (ash_util::IsRunningInMash()) { | 69 if (IsRunningInMash()) { |
70 using ui::mojom::WindowManager; | 70 using ui::mojom::WindowManager; |
71 params.mus_properties[WindowManager::kContainerId_InitProperty] = | 71 params.mus_properties[WindowManager::kContainerId_InitProperty] = |
72 mojo::ConvertTo<std::vector<uint8_t>>(container_id); | 72 mojo::ConvertTo<std::vector<uint8_t>>(container_id); |
73 } else { | 73 } else { |
74 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 74 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
75 container_id); | 75 container_id); |
76 } | 76 } |
77 widget->Init(params); | 77 widget->Init(params); |
78 | 78 |
79 // Observer is needed for ChromeVox extension to send messages between content | 79 // Observer is needed for ChromeVox extension to send messages between content |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 return false; | 133 return false; |
134 } | 134 } |
135 | 135 |
136 bool BluetoothPairingDialog::HandleContextMenu( | 136 bool BluetoothPairingDialog::HandleContextMenu( |
137 const content::ContextMenuParams& params) { | 137 const content::ContextMenuParams& params) { |
138 // Disable context menu. | 138 // Disable context menu. |
139 return true; | 139 return true; |
140 } | 140 } |
141 | 141 |
142 } // namespace chromeos | 142 } // namespace chromeos |
OLD | NEW |