| 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/app_shortcut_launcher_item_controller.h
" | 5 #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h
" |
| 6 | 6 |
| 7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
| 8 #include "chrome/browser/favicon/favicon_tab_helper.h" | 8 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 9 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
| 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 Browser* browser = chrome::FindBrowserWithWebContents(content[i]); | 87 Browser* browser = chrome::FindBrowserWithWebContents(content[i]); |
| 88 if (!browser) | 88 if (!browser) |
| 89 continue; | 89 continue; |
| 90 TabStripModel* tab_strip = browser->tab_strip_model(); | 90 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 91 int index = tab_strip->GetIndexOfWebContents(content[i]); | 91 int index = tab_strip->GetIndexOfWebContents(content[i]); |
| 92 DCHECK(index != TabStripModel::kNoTab); | 92 DCHECK(index != TabStripModel::kNoTab); |
| 93 tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_NONE); | 93 tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_NONE); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 void AppShortcutLauncherItemController::Clicked() { | 97 void AppShortcutLauncherItemController::Clicked(const ui::Event& event) { |
| 98 Activate(); | 98 Activate(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void AppShortcutLauncherItemController::OnRemoved() { | 101 void AppShortcutLauncherItemController::OnRemoved() { |
| 102 // AppShortcutLauncherItemController is unowned; delete on removal. | 102 // AppShortcutLauncherItemController is unowned; delete on removal. |
| 103 delete this; | 103 delete this; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void AppShortcutLauncherItemController::LauncherItemChanged( | 106 void AppShortcutLauncherItemController::LauncherItemChanged( |
| 107 int model_index, | 107 int model_index, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 refocus_pattern.MatchesURL(tab_url)) || | 164 refocus_pattern.MatchesURL(tab_url)) || |
| 165 (extension->OverlapsWithOrigin(tab_url) && | 165 (extension->OverlapsWithOrigin(tab_url) && |
| 166 extension->web_extent().MatchesURL(tab_url)) || | 166 extension->web_extent().MatchesURL(tab_url)) || |
| 167 launcher_controller()->GetPerAppInterface()-> | 167 launcher_controller()->GetPerAppInterface()-> |
| 168 IsWebContentHandledByApplication(web_contents, app_id())) | 168 IsWebContentHandledByApplication(web_contents, app_id())) |
| 169 items.push_back(web_contents); | 169 items.push_back(web_contents); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 return items; | 172 return items; |
| 173 } | 173 } |
| OLD | NEW |