| 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/aura/wm_window_aura.h" | |
| 10 #include "ash/common/shelf/shelf_delegate.h" | 9 #include "ash/common/shelf/shelf_delegate.h" |
| 11 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| 12 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 12 #include "ash/common/wm_window.h" |
| 13 #include "ash/common/wm_window_property.h" | 13 #include "ash/common/wm_window_property.h" |
| 14 #include "ash/resources/grit/ash_resources.h" | 14 #include "ash/resources/grit/ash_resources.h" |
| 15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
| 16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 18 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
| 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h
" | 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h
" |
| 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h" | 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_tab.h" |
| 21 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 21 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" | 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 void BrowserShortcutLauncherItemController::SetShelfIDForBrowserWindowContents( | 118 void BrowserShortcutLauncherItemController::SetShelfIDForBrowserWindowContents( |
| 119 Browser* browser, | 119 Browser* browser, |
| 120 content::WebContents* web_contents) { | 120 content::WebContents* web_contents) { |
| 121 // We need to set the window ShelfID for V1 applications since they are | 121 // We need to set the window ShelfID for V1 applications since they are |
| 122 // content which might change and as such change the application type. | 122 // content which might change and as such change the application type. |
| 123 if (!browser || !IsBrowserFromActiveUser(browser) || | 123 if (!browser || !IsBrowserFromActiveUser(browser) || |
| 124 IsSettingsBrowser(browser)) | 124 IsSettingsBrowser(browser)) |
| 125 return; | 125 return; |
| 126 | 126 |
| 127 ash::WmWindowAura::Get(browser->window()->GetNativeWindow()) | 127 ash::WmWindow::Get(browser->window()->GetNativeWindow()) |
| 128 ->SetIntProperty( | 128 ->SetIntProperty( |
| 129 ash::WmWindowProperty::SHELF_ID, | 129 ash::WmWindowProperty::SHELF_ID, |
| 130 launcher_controller()->GetShelfIDForWebContents(web_contents)); | 130 launcher_controller()->GetShelfIDForWebContents(web_contents)); |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool BrowserShortcutLauncherItemController::IsVisible() const { | 133 bool BrowserShortcutLauncherItemController::IsVisible() const { |
| 134 Browser* last_browser = | 134 Browser* last_browser = |
| 135 chrome::FindTabbedBrowser(launcher_controller()->profile(), true); | 135 chrome::FindTabbedBrowser(launcher_controller()->profile(), true); |
| 136 | 136 |
| 137 if (!last_browser) { | 137 if (!last_browser) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 !browser->window()->IsMinimized()) { | 336 !browser->window()->IsMinimized()) { |
| 337 continue; | 337 continue; |
| 338 } | 338 } |
| 339 if (!IsBrowserRepresentedInBrowserList(browser) && | 339 if (!IsBrowserRepresentedInBrowserList(browser) && |
| 340 !browser->is_type_tabbed()) | 340 !browser->is_type_tabbed()) |
| 341 continue; | 341 continue; |
| 342 active_browsers.push_back(browser); | 342 active_browsers.push_back(browser); |
| 343 } | 343 } |
| 344 return active_browsers; | 344 return active_browsers; |
| 345 } | 345 } |
| OLD | NEW |