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 "ash/shell/window_type_launcher.h" | 5 #include "ash/shell/window_type_launcher.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/screensaver/screensaver_view.h" | 8 #include "ash/screensaver/screensaver_view.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell/example_factory.h" | 10 #include "ash/shell/example_factory.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void AddViewToLayout(views::GridLayout* layout, views::View* view) { | 176 void AddViewToLayout(views::GridLayout* layout, views::View* view) { |
177 layout->StartRow(0, 0); | 177 layout->StartRow(0, 0); |
178 layout->AddView(view); | 178 layout->AddView(view); |
179 layout->AddPaddingRow(0, 5); | 179 layout->AddPaddingRow(0, 5); |
180 } | 180 } |
181 | 181 |
182 } // namespace | 182 } // namespace |
183 | 183 |
184 void InitWindowTypeLauncher() { | 184 void InitWindowTypeLauncher() { |
185 views::Widget* widget = | 185 views::Widget* widget = |
186 views::Widget::CreateWindowWithBounds(new WindowTypeLauncher, | 186 views::Widget::CreateWindowWithContextAndBounds( |
187 gfx::Rect(120, 150, 300, 410)); | 187 new WindowTypeLauncher, |
| 188 Shell::GetPrimaryRootWindow(), |
| 189 gfx::Rect(120, 150, 300, 410)); |
188 widget->GetNativeView()->SetName("WindowTypeLauncher"); | 190 widget->GetNativeView()->SetName("WindowTypeLauncher"); |
189 views::corewm::SetShadowType(widget->GetNativeView(), | 191 views::corewm::SetShadowType(widget->GetNativeView(), |
190 views::corewm::SHADOW_TYPE_RECTANGULAR); | 192 views::corewm::SHADOW_TYPE_RECTANGULAR); |
191 widget->Show(); | 193 widget->Show(); |
192 } | 194 } |
193 | 195 |
194 WindowTypeLauncher::WindowTypeLauncher() | 196 WindowTypeLauncher::WindowTypeLauncher() |
195 : ALLOW_THIS_IN_INITIALIZER_LIST(create_button_( | 197 : ALLOW_THIS_IN_INITIALIZER_LIST(create_button_( |
196 new views::NativeTextButton(this, ASCIIToUTF16("Create Window")))), | 198 new views::NativeTextButton(this, ASCIIToUTF16("Create Window")))), |
197 ALLOW_THIS_IN_INITIALIZER_LIST(create_persistant_button_( | 199 ALLOW_THIS_IN_INITIALIZER_LIST(create_persistant_button_( |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), | 387 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), |
386 MenuItemView::TOPLEFT, | 388 MenuItemView::TOPLEFT, |
387 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 389 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
388 MenuRunner::MENU_DELETED) | 390 MenuRunner::MENU_DELETED) |
389 return; | 391 return; |
390 } | 392 } |
391 #endif // !defined(OS_MACOSX) | 393 #endif // !defined(OS_MACOSX) |
392 | 394 |
393 } // namespace shell | 395 } // namespace shell |
394 } // namespace ash | 396 } // namespace ash |
OLD | NEW |