OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/aura/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" |
6 | 6 |
| 7 #include "base/command_line.h" |
7 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
8 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/views/aura/app_list_window.h" | 10 #include "chrome/browser/ui/views/aura/app_list_window.h" |
| 11 #include "chrome/browser/ui/views/aura/app_list/app_list_model.h" |
10 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" | 12 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" |
11 #include "chrome/browser/ui/views/frame/browser_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 14 #include "ui/aura/aura_switches.h" |
12 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 16 #include "ui/aura_shell/app_list/app_list_view.h" |
13 #include "ui/aura_shell/launcher/launcher_types.h" | 17 #include "ui/aura_shell/launcher/launcher_types.h" |
14 #include "ui/aura_shell/window_util.h" | 18 #include "ui/aura_shell/window_util.h" |
15 | 19 |
16 // static | 20 // static |
17 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; | 21 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; |
18 | 22 |
19 ChromeShellDelegate::ChromeShellDelegate() { | 23 ChromeShellDelegate::ChromeShellDelegate() { |
20 instance_ = this; | 24 instance_ = this; |
21 } | 25 } |
22 | 26 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 views::Widget* ChromeShellDelegate::CreateStatusArea() { | 58 views::Widget* ChromeShellDelegate::CreateStatusArea() { |
55 status_area_host_.reset(new StatusAreaHostAura()); | 59 status_area_host_.reset(new StatusAreaHostAura()); |
56 views::Widget* status_area_widget = | 60 views::Widget* status_area_widget = |
57 status_area_host_.get()->CreateStatusArea(); | 61 status_area_host_.get()->CreateStatusArea(); |
58 return status_area_widget; | 62 return status_area_widget; |
59 } | 63 } |
60 | 64 |
61 void ChromeShellDelegate::RequestAppListWidget( | 65 void ChromeShellDelegate::RequestAppListWidget( |
62 const gfx::Rect& bounds, | 66 const gfx::Rect& bounds, |
63 const SetWidgetCallback& callback) { | 67 const SetWidgetCallback& callback) { |
64 // AppListWindow deletes itself when closed. | 68 // AppListWindow and AppListView deletes itself when closed. |
65 new AppListWindow(bounds, callback); | 69 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraViewsAppList)) |
| 70 new aura_shell::AppListView(new AppListModel(), bounds, callback); |
| 71 else |
| 72 new AppListWindow(bounds, callback); |
66 } | 73 } |
67 | 74 |
68 void ChromeShellDelegate::LauncherItemClicked( | 75 void ChromeShellDelegate::LauncherItemClicked( |
69 const aura_shell::LauncherItem& item) { | 76 const aura_shell::LauncherItem& item) { |
70 aura_shell::ActivateWindow(item.window); | 77 aura_shell::ActivateWindow(item.window); |
71 } | 78 } |
72 | 79 |
73 bool ChromeShellDelegate::ConfigureLauncherItem( | 80 bool ChromeShellDelegate::ConfigureLauncherItem( |
74 aura_shell::LauncherItem* item) { | 81 aura_shell::LauncherItem* item) { |
75 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); | 82 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); |
76 return view && | 83 return view && |
77 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); | 84 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); |
78 } | 85 } |
OLD | NEW |