Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 253983002: Use centered app list position whenever virtual keyboard is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed ExampleAppListViewDelegate (caused tree to close). Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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"
37 #include "ui/app_list/app_list_view_delegate_observer.h" 38 #include "ui/app_list/app_list_view_delegate_observer.h"
38 #include "ui/app_list/search_box_model.h" 39 #include "ui/app_list/search_box_model.h"
39 #include "ui/app_list/speech_ui_model.h" 40 #include "ui/app_list/speech_ui_model.h"
40 #include "ui/base/resource/resource_bundle.h" 41 #include "ui/base/resource/resource_bundle.h"
41 42
43 #if defined(USE_AURA)
44 #include "ui/keyboard/keyboard_util.h"
45 #endif
46
42 #if defined(USE_ASH) 47 #if defined(USE_ASH)
43 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" 48 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h"
44 #endif 49 #endif
45 50
46 #if defined(OS_WIN) 51 #if defined(OS_WIN)
47 #include "chrome/browser/web_applications/web_app_win.h" 52 #include "chrome/browser/web_applications/web_app_win.h"
48 #endif 53 #endif
49 54
50 namespace { 55 namespace {
51 56
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 return NULL; 410 return NULL;
406 411
407 return service->GetSpeechRecognitionContents(); 412 return service->GetSpeechRecognitionContents();
408 } 413 }
409 414
410 const app_list::AppListViewDelegate::Users& 415 const app_list::AppListViewDelegate::Users&
411 AppListViewDelegate::GetUsers() const { 416 AppListViewDelegate::GetUsers() const {
412 return users_; 417 return users_;
413 } 418 }
414 419
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
415 void AppListViewDelegate::AddObserver( 435 void AppListViewDelegate::AddObserver(
416 app_list::AppListViewDelegateObserver* observer) { 436 app_list::AppListViewDelegateObserver* observer) {
417 observers_.AddObserver(observer); 437 observers_.AddObserver(observer);
418 } 438 }
419 439
420 void AppListViewDelegate::RemoveObserver( 440 void AppListViewDelegate::RemoveObserver(
421 app_list::AppListViewDelegateObserver* observer) { 441 app_list::AppListViewDelegateObserver* observer) {
422 observers_.RemoveObserver(observer); 442 observers_.RemoveObserver(observer);
423 } 443 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/browser/ui/views/app_list/linux/app_list_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698