| 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/ui/app_list/app_list_view_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "ui/app_list/app_list_view_delegate_observer.h" | 38 #include "ui/app_list/app_list_view_delegate_observer.h" |
| 39 #include "ui/app_list/search_box_model.h" | 39 #include "ui/app_list/search_box_model.h" |
| 40 #include "ui/app_list/speech_ui_model.h" | 40 #include "ui/app_list/speech_ui_model.h" |
| 41 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
| 42 | 42 |
| 43 #if defined(USE_AURA) | 43 #if defined(USE_AURA) |
| 44 #include "ui/keyboard/keyboard_util.h" | 44 #include "ui/keyboard/keyboard_util.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if defined(USE_ASH) | 47 #if defined(USE_ASH) |
| 48 #include "ash/shell.h" |
| 49 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 48 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" | 50 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" |
| 49 #endif | 51 #endif |
| 50 | 52 |
| 51 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 52 #include "chrome/browser/web_applications/web_app_win.h" | 54 #include "chrome/browser/web_applications/web_app_win.h" |
| 53 #endif | 55 #endif |
| 54 | 56 |
| 55 namespace { | 57 namespace { |
| 56 | 58 |
| 57 const int kAutoLaunchDefaultTimeoutMilliSec = 50; | 59 const int kAutoLaunchDefaultTimeoutMilliSec = 50; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return true; | 424 return true; |
| 423 | 425 |
| 424 // keyboard depends upon Aura. | 426 // keyboard depends upon Aura. |
| 425 #if defined(USE_AURA) | 427 #if defined(USE_AURA) |
| 426 // If the virtual keyboard is enabled, use the new app list position. The old | 428 // If the virtual keyboard is enabled, use the new app list position. The old |
| 427 // position is too tall, and doesn't fit in the left-over screen space. | 429 // position is too tall, and doesn't fit in the left-over screen space. |
| 428 if (keyboard::IsKeyboardEnabled()) | 430 if (keyboard::IsKeyboardEnabled()) |
| 429 return true; | 431 return true; |
| 430 #endif | 432 #endif |
| 431 | 433 |
| 434 #if defined(USE_ASH) |
| 435 // If it is at all possible to enter maximize mode in this configuration |
| 436 // (which has a virtual keyboard), we should use the experimental position. |
| 437 // This avoids having the app list change shape and position as the user |
| 438 // enters and exits maximize mode. |
| 439 if (ash::Shell::HasInstance() && |
| 440 ash::Shell::GetInstance() |
| 441 ->maximize_mode_controller() |
| 442 ->CanEnterMaximizeMode()) { |
| 443 return true; |
| 444 } |
| 445 #endif |
| 446 |
| 432 return false; | 447 return false; |
| 433 } | 448 } |
| 434 | 449 |
| 435 void AppListViewDelegate::AddObserver( | 450 void AppListViewDelegate::AddObserver( |
| 436 app_list::AppListViewDelegateObserver* observer) { | 451 app_list::AppListViewDelegateObserver* observer) { |
| 437 observers_.AddObserver(observer); | 452 observers_.AddObserver(observer); |
| 438 } | 453 } |
| 439 | 454 |
| 440 void AppListViewDelegate::RemoveObserver( | 455 void AppListViewDelegate::RemoveObserver( |
| 441 app_list::AppListViewDelegateObserver* observer) { | 456 app_list::AppListViewDelegateObserver* observer) { |
| 442 observers_.RemoveObserver(observer); | 457 observers_.RemoveObserver(observer); |
| 443 } | 458 } |
| OLD | NEW |