| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_shortcut_launcher_item_controll
er.h" | 5 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 if (items.empty()) { | 282 if (items.empty()) { |
| 283 launcher_controller()->CreateNewWindow(); | 283 launcher_controller()->CreateNewWindow(); |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 Browser* browser = chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); | 286 Browser* browser = chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); |
| 287 if (items.size() == 1) { | 287 if (items.size() == 1) { |
| 288 // If there is only one suitable browser, we can either activate it, or | 288 // If there is only one suitable browser, we can either activate it, or |
| 289 // bounce it (if it is already active). | 289 // bounce it (if it is already active). |
| 290 if (browser == items[0]) { | 290 if (browser == items[0]) { |
| 291 AnimateWindow(browser->window()->GetNativeWindow(), | 291 AnimateWindow(browser->window()->GetNativeWindow(), |
| 292 views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); | 292 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 293 return; | 293 return; |
| 294 } | 294 } |
| 295 browser = items[0]; | 295 browser = items[0]; |
| 296 } else { | 296 } else { |
| 297 // If there is more then one suitable browser, we advance to the next if | 297 // If there is more then one suitable browser, we advance to the next if |
| 298 // |browser| is already active - or - check the last used browser if it can | 298 // |browser| is already active - or - check the last used browser if it can |
| 299 // be used. | 299 // be used. |
| 300 std::vector<Browser*>::iterator i = | 300 std::vector<Browser*>::iterator i = |
| 301 std::find(items.begin(), items.end(), browser); | 301 std::find(items.begin(), items.end(), browser); |
| 302 if (i != items.end()) { | 302 if (i != items.end()) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 320 return (browser && | 320 return (browser && |
| 321 launcher_controller()->IsBrowserFromActiveUser(browser) && | 321 launcher_controller()->IsBrowserFromActiveUser(browser) && |
| 322 browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH && | 322 browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH && |
| 323 (browser->is_type_tabbed() || | 323 (browser->is_type_tabbed() || |
| 324 !browser->is_app() || | 324 !browser->is_app() || |
| 325 !browser->is_type_popup() || | 325 !browser->is_type_popup() || |
| 326 launcher_controller()-> | 326 launcher_controller()-> |
| 327 GetShelfIDForAppID(web_app::GetExtensionIdFromApplicationName( | 327 GetShelfIDForAppID(web_app::GetExtensionIdFromApplicationName( |
| 328 browser->app_name())) <= 0)); | 328 browser->app_name())) <= 0)); |
| 329 } | 329 } |
| OLD | NEW |