| 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/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 10 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 11 #include "ui/aura_shell/launcher/launcher_types.h" | 12 #include "ui/aura_shell/launcher/launcher_types.h" |
| 12 | 13 |
| 13 ChromeShellDelegate::ChromeShellDelegate() { | 14 ChromeShellDelegate::ChromeShellDelegate() { |
| 14 } | 15 } |
| 15 | 16 |
| 16 ChromeShellDelegate::~ChromeShellDelegate() { | 17 ChromeShellDelegate::~ChromeShellDelegate() { |
| 17 } | 18 } |
| 18 | 19 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 } | 33 } |
| 33 | 34 |
| 34 void ChromeShellDelegate::CreateNewWindow() { | 35 void ChromeShellDelegate::CreateNewWindow() { |
| 35 Browser* browser = Browser::Create( | 36 Browser* browser = Browser::Create( |
| 36 ProfileManager::GetDefaultProfile()->GetOriginalProfile()); | 37 ProfileManager::GetDefaultProfile()->GetOriginalProfile()); |
| 37 browser->AddSelectedTabWithURL(GURL(), content::PAGE_TRANSITION_START_PAGE); | 38 browser->AddSelectedTabWithURL(GURL(), content::PAGE_TRANSITION_START_PAGE); |
| 38 browser->window()->Show(); | 39 browser->window()->Show(); |
| 39 } | 40 } |
| 40 | 41 |
| 41 void ChromeShellDelegate::ShowApps() { | 42 void ChromeShellDelegate::ShowApps() { |
| 43 AppListWindow::SetVisible(!AppListWindow::IsVisible()); |
| 42 } | 44 } |
| 43 | 45 |
| 44 void ChromeShellDelegate::LauncherItemClicked( | 46 void ChromeShellDelegate::LauncherItemClicked( |
| 45 const aura_shell::LauncherItem& item) { | 47 const aura_shell::LauncherItem& item) { |
| 46 item.window->Activate(); | 48 item.window->Activate(); |
| 47 } | 49 } |
| 48 | 50 |
| 49 bool ChromeShellDelegate::ConfigureLauncherItem( | 51 bool ChromeShellDelegate::ConfigureLauncherItem( |
| 50 aura_shell::LauncherItem* item) { | 52 aura_shell::LauncherItem* item) { |
| 51 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); | 53 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); |
| 52 return view && | 54 return view && |
| 53 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); | 55 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); |
| 54 } | 56 } |
| OLD | NEW |