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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ash/shelf/shelf_model.h" | 9 #include "ash/shelf/shelf_model.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 refocus_pattern.Parse(refocus_url_.spec()); | 170 refocus_pattern.Parse(refocus_url_.spec()); |
171 } | 171 } |
172 | 172 |
173 const Extension* extension = | 173 const Extension* extension = |
174 launcher_controller()->GetExtensionForAppID(app_id()); | 174 launcher_controller()->GetExtensionForAppID(app_id()); |
175 | 175 |
176 // It is possible to come here While an extension gets loaded. | 176 // It is possible to come here While an extension gets loaded. |
177 if (!extension) | 177 if (!extension) |
178 return items; | 178 return items; |
179 | 179 |
180 for (auto& browser : *BrowserList::GetInstance()) { | 180 for (auto* browser : *BrowserList::GetInstance()) { |
181 if (!launcher_controller()->IsBrowserFromActiveUser(browser)) | 181 if (!launcher_controller()->IsBrowserFromActiveUser(browser)) |
182 continue; | 182 continue; |
183 TabStripModel* tab_strip = browser->tab_strip_model(); | 183 TabStripModel* tab_strip = browser->tab_strip_model(); |
184 for (int index = 0; index < tab_strip->count(); index++) { | 184 for (int index = 0; index < tab_strip->count(); index++) { |
185 content::WebContents* web_contents = tab_strip->GetWebContentsAt(index); | 185 content::WebContents* web_contents = tab_strip->GetWebContentsAt(index); |
186 if (WebContentMatchesApp( | 186 if (WebContentMatchesApp( |
187 extension, refocus_pattern, web_contents, browser)) | 187 extension, refocus_pattern, web_contents, browser)) |
188 items.push_back(web_contents); | 188 items.push_back(web_contents); |
189 } | 189 } |
190 } | 190 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { | 370 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { |
371 if (last_launch_attempt_.is_null() || | 371 if (last_launch_attempt_.is_null() || |
372 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( | 372 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( |
373 kClickSuppressionInMS) < base::Time::Now()) { | 373 kClickSuppressionInMS) < base::Time::Now()) { |
374 last_launch_attempt_ = base::Time::Now(); | 374 last_launch_attempt_ = base::Time::Now(); |
375 return true; | 375 return true; |
376 } | 376 } |
377 return false; | 377 return false; |
378 } | 378 } |
OLD | NEW |