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