Chromium Code Reviews| 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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 // the border to be shown. See http://crbug.com/231687 . | 352 // the border to be shown. See http://crbug.com/231687 . |
| 353 GetWidget()->Hide(); | 353 GetWidget()->Hide(); |
| 354 #endif | 354 #endif |
| 355 | 355 |
| 356 if (delegate_) | 356 if (delegate_) |
| 357 delegate_->ViewInitialized(); | 357 delegate_->ViewInitialized(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 gfx::Point AppListView::GetCenterPoint() { | 360 gfx::Point AppListView::GetCenterPoint() { |
| 361 DCHECK(screen_to_keep_centered_on_); | 361 DCHECK(screen_to_keep_centered_on_); |
| 362 gfx::Rect bounds = screen_to_keep_centered_on_->GetPrimaryDisplay().bounds(); | 362 gfx::Rect bounds = screen_to_keep_centered_on_->GetPrimaryDisplay().bounds(); |
|
tapted
2014/04/29 03:39:17
Can we just center in the WorkArea rather than bou
Matt Giuca
2014/04/29 05:51:35
Hmm... unfortunately it looks like the order is wr
tapted
2014/04/29 06:09:53
Drat. Maybe a short note here like
// Can't use
Matt Giuca
2014/04/29 06:26:11
Done.
| |
| 363 | |
| 364 // If the virtual keyboard is active, subtract it from the display bounds, so | |
| 365 // that the app list is centered in the non-keyboard area of the display. | |
| 366 gfx::Rect keyboard_bounds = delegate_->GetVirtualKeyboardBounds(); | |
| 367 if (!keyboard_bounds.IsEmpty()) | |
| 368 bounds.Subtract(keyboard_bounds); | |
| 369 | |
| 363 return bounds.CenterPoint(); | 370 return bounds.CenterPoint(); |
| 364 } | 371 } |
| 365 | 372 |
| 366 void AppListView::OnBeforeBubbleWidgetInit( | 373 void AppListView::OnBeforeBubbleWidgetInit( |
| 367 views::Widget::InitParams* params, | 374 views::Widget::InitParams* params, |
| 368 views::Widget* widget) const { | 375 views::Widget* widget) const { |
| 369 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | 376 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
| 370 if (delegate_ && delegate_->ForceNativeDesktop()) | 377 if (delegate_ && delegate_->ForceNativeDesktop()) |
| 371 params->native_widget = new views::DesktopNativeWidgetAura(widget); | 378 params->native_widget = new views::DesktopNativeWidgetAura(widget); |
| 372 #endif | 379 #endif |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 #else | 543 #else |
| 537 speech_view_->SetVisible(recognizing); | 544 speech_view_->SetVisible(recognizing); |
| 538 app_list_main_view_->SetVisible(!recognizing); | 545 app_list_main_view_->SetVisible(!recognizing); |
| 539 | 546 |
| 540 // Needs to schedule paint of AppListView itself, to repaint the background. | 547 // Needs to schedule paint of AppListView itself, to repaint the background. |
| 541 GetBubbleFrameView()->SchedulePaint(); | 548 GetBubbleFrameView()->SchedulePaint(); |
| 542 #endif | 549 #endif |
| 543 } | 550 } |
| 544 | 551 |
| 545 } // namespace app_list | 552 } // namespace app_list |
| OLD | NEW |