| 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 "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/views/aura/app_list_window.h" | 9 #include "chrome/browser/ui/views/aura/app_list_window.h" |
| 10 #include "chrome/browser/ui/views/aura/app_list/app_list_model_builder.h" | |
| 11 #include "chrome/browser/ui/views/aura/app_list/app_list_view_delegate.h" | |
| 12 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" | 10 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" |
| 13 #include "chrome/browser/ui/views/frame/browser_view.h" | 11 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 14 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 15 #include "ui/aura_shell/launcher/launcher_types.h" | 13 #include "ui/aura_shell/launcher/launcher_types.h" |
| 16 #include "ui/aura_shell/window_util.h" | 14 #include "ui/aura_shell/window_util.h" |
| 17 | 15 |
| 18 // static | 16 // static |
| 19 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; | 17 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; |
| 20 | 18 |
| 21 ChromeShellDelegate::ChromeShellDelegate() { | 19 ChromeShellDelegate::ChromeShellDelegate() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return status_area_widget; | 57 return status_area_widget; |
| 60 } | 58 } |
| 61 | 59 |
| 62 void ChromeShellDelegate::RequestAppListWidget( | 60 void ChromeShellDelegate::RequestAppListWidget( |
| 63 const gfx::Rect& bounds, | 61 const gfx::Rect& bounds, |
| 64 const SetWidgetCallback& callback) { | 62 const SetWidgetCallback& callback) { |
| 65 // AppListWindow deletes itself when closed. | 63 // AppListWindow deletes itself when closed. |
| 66 new AppListWindow(bounds, callback); | 64 new AppListWindow(bounds, callback); |
| 67 } | 65 } |
| 68 | 66 |
| 69 void ChromeShellDelegate::BuildAppListModel(aura_shell::AppListModel* model) { | |
| 70 AppListModelBuilder builder(ProfileManager::GetDefaultProfile(), | |
| 71 model); | |
| 72 builder.Build(); | |
| 73 } | |
| 74 | |
| 75 aura_shell::AppListViewDelegate* | |
| 76 ChromeShellDelegate::CreateAppListViewDelegate() { | |
| 77 // Shell will own the created delegate. | |
| 78 return new AppListViewDelegate; | |
| 79 } | |
| 80 | |
| 81 void ChromeShellDelegate::LauncherItemClicked( | 67 void ChromeShellDelegate::LauncherItemClicked( |
| 82 const aura_shell::LauncherItem& item) { | 68 const aura_shell::LauncherItem& item) { |
| 83 aura_shell::ActivateWindow(item.window); | 69 aura_shell::ActivateWindow(item.window); |
| 84 } | 70 } |
| 85 | 71 |
| 86 bool ChromeShellDelegate::ConfigureLauncherItem( | 72 bool ChromeShellDelegate::ConfigureLauncherItem( |
| 87 aura_shell::LauncherItem* item) { | 73 aura_shell::LauncherItem* item) { |
| 88 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); | 74 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); |
| 89 return view && | 75 return view && |
| 90 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); | 76 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); |
| 91 } | 77 } |
| OLD | NEW |