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 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/ui/host_desktop.h" | 27 #include "chrome/browser/ui/host_desktop.h" |
28 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 28 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
29 #include "chrome/browser/web_applications/web_app.h" | 29 #include "chrome/browser/web_applications/web_app.h" |
30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
32 #include "components/signin/core/browser/signin_manager.h" | 32 #include "components/signin/core/browser/signin_manager.h" |
33 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
34 #include "content/public/browser/page_navigator.h" | 34 #include "content/public/browser/page_navigator.h" |
35 #include "content/public/browser/user_metrics.h" | 35 #include "content/public/browser/user_metrics.h" |
36 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
37 #include "ui/app_list/app_list_switches.h" | |
38 #include "ui/app_list/app_list_view_delegate_observer.h" | 37 #include "ui/app_list/app_list_view_delegate_observer.h" |
39 #include "ui/app_list/search_box_model.h" | 38 #include "ui/app_list/search_box_model.h" |
40 #include "ui/app_list/speech_ui_model.h" | 39 #include "ui/app_list/speech_ui_model.h" |
41 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
42 | 41 |
43 #if defined(USE_AURA) | |
44 #include "ui/keyboard/keyboard_util.h" | |
45 #endif | |
46 | |
47 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
48 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" | 43 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" |
49 #endif | 44 #endif |
50 | 45 |
51 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
52 #include "chrome/browser/web_applications/web_app_win.h" | 47 #include "chrome/browser/web_applications/web_app_win.h" |
53 #endif | 48 #endif |
54 | 49 |
55 namespace { | 50 namespace { |
56 | 51 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 return NULL; | 405 return NULL; |
411 | 406 |
412 return service->GetSpeechRecognitionContents(); | 407 return service->GetSpeechRecognitionContents(); |
413 } | 408 } |
414 | 409 |
415 const app_list::AppListViewDelegate::Users& | 410 const app_list::AppListViewDelegate::Users& |
416 AppListViewDelegate::GetUsers() const { | 411 AppListViewDelegate::GetUsers() const { |
417 return users_; | 412 return users_; |
418 } | 413 } |
419 | 414 |
420 bool AppListViewDelegate::ShouldCenterWindow() const { | |
421 if (app_list::switches::IsCenteredAppListEnabled()) | |
422 return true; | |
423 | |
424 // keyboard depends upon Aura. | |
425 #if defined(USE_AURA) | |
426 // 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. | |
428 if (keyboard::IsKeyboardEnabled()) | |
429 return true; | |
430 #endif | |
431 | |
432 return false; | |
433 } | |
434 | |
435 void AppListViewDelegate::AddObserver( | 415 void AppListViewDelegate::AddObserver( |
436 app_list::AppListViewDelegateObserver* observer) { | 416 app_list::AppListViewDelegateObserver* observer) { |
437 observers_.AddObserver(observer); | 417 observers_.AddObserver(observer); |
438 } | 418 } |
439 | 419 |
440 void AppListViewDelegate::RemoveObserver( | 420 void AppListViewDelegate::RemoveObserver( |
441 app_list::AppListViewDelegateObserver* observer) { | 421 app_list::AppListViewDelegateObserver* observer) { |
442 observers_.RemoveObserver(observer); | 422 observers_.RemoveObserver(observer); |
443 } | 423 } |
OLD | NEW |