| OLD | NEW |
| 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/ash/launcher/chrome_launcher_controller_per_browser.
h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.
h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual void Activate() OVERRIDE { | 97 virtual void Activate() OVERRIDE { |
| 98 launcher_controller()->ActivateApp(app_id(), ui::EF_NONE); | 98 launcher_controller()->ActivateApp(app_id(), ui::EF_NONE); |
| 99 } | 99 } |
| 100 | 100 |
| 101 virtual void Close() OVERRIDE { | 101 virtual void Close() OVERRIDE { |
| 102 // TODO: maybe should treat as unpin? | 102 // TODO: maybe should treat as unpin? |
| 103 } | 103 } |
| 104 | 104 |
| 105 virtual void Clicked() OVERRIDE { | 105 virtual void Clicked(const ui::Event& event) OVERRIDE { |
| 106 Activate(); | 106 Activate(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 virtual void OnRemoved() OVERRIDE { | 109 virtual void OnRemoved() OVERRIDE { |
| 110 // AppShortcutLauncherItemController is unowned; delete on removal. | 110 // AppShortcutLauncherItemController is unowned; delete on removal. |
| 111 delete this; | 111 delete this; |
| 112 } | 112 } |
| 113 | 113 |
| 114 virtual void LauncherItemChanged( | 114 virtual void LauncherItemChanged( |
| 115 int model_index, | 115 int model_index, |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 return; | 803 return; |
| 804 } | 804 } |
| 805 | 805 |
| 806 aura::Window* window = last_browser->window()->GetNativeWindow(); | 806 aura::Window* window = last_browser->window()->GetNativeWindow(); |
| 807 window->Show(); | 807 window->Show(); |
| 808 ash::wm::ActivateWindow(window); | 808 ash::wm::ActivateWindow(window); |
| 809 } | 809 } |
| 810 | 810 |
| 811 void ChromeLauncherControllerPerBrowser::ItemClicked( | 811 void ChromeLauncherControllerPerBrowser::ItemClicked( |
| 812 const ash::LauncherItem& item, | 812 const ash::LauncherItem& item, |
| 813 int event_flags) { | 813 const ui::Event& event) { |
| 814 DCHECK(HasItemController(item.id)); | 814 DCHECK(HasItemController(item.id)); |
| 815 id_to_item_controller_map_[item.id]->Clicked(); | 815 id_to_item_controller_map_[item.id]->Clicked(event); |
| 816 } | 816 } |
| 817 | 817 |
| 818 int ChromeLauncherControllerPerBrowser::GetBrowserShortcutResourceId() { | 818 int ChromeLauncherControllerPerBrowser::GetBrowserShortcutResourceId() { |
| 819 return IDR_PRODUCT_LOGO_32; | 819 return IDR_PRODUCT_LOGO_32; |
| 820 } | 820 } |
| 821 | 821 |
| 822 string16 ChromeLauncherControllerPerBrowser::GetTitle( | 822 string16 ChromeLauncherControllerPerBrowser::GetTitle( |
| 823 const ash::LauncherItem& item) { | 823 const ash::LauncherItem& item) { |
| 824 DCHECK(HasItemController(item.id)); | 824 DCHECK(HasItemController(item.id)); |
| 825 return id_to_item_controller_map_[item.id]->GetTitle(); | 825 return id_to_item_controller_map_[item.id]->GetTitle(); |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1262 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
| 1263 ash::AppIconLoader* loader) { | 1263 ash::AppIconLoader* loader) { |
| 1264 app_icon_loader_.reset(loader); | 1264 app_icon_loader_.reset(loader); |
| 1265 } | 1265 } |
| 1266 | 1266 |
| 1267 const std::string& | 1267 const std::string& |
| 1268 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1268 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
| 1269 ash::LauncherID id) { | 1269 ash::LauncherID id) { |
| 1270 return id_to_item_controller_map_[id]->app_id(); | 1270 return id_to_item_controller_map_[id]->app_id(); |
| 1271 } | 1271 } |
| OLD | NEW |