| OLD | NEW | 
|    1 // Copyright 2013 The Chromium Authors. All rights reserved. |    1 // Copyright 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/multi_profile_browser_status_monitor.h" |    5 #include "chrome/browser/ui/ash/launcher/multi_profile_browser_status_monitor.h" | 
|    6  |    6  | 
|    7 #include "ash/aura/wm_window_aura.h" |  | 
|    8 #include "ash/common/shelf/shelf_item_types.h" |    7 #include "ash/common/shelf/shelf_item_types.h" | 
 |    8 #include "ash/common/wm_window.h" | 
|    9 #include "ash/common/wm_window_observer.h" |    9 #include "ash/common/wm_window_observer.h" | 
|   10 #include "ash/common/wm_window_property.h" |   10 #include "ash/common/wm_window_property.h" | 
|   11 #include "chrome/browser/profiles/profile.h" |   11 #include "chrome/browser/profiles/profile.h" | 
|   12 #include "chrome/browser/profiles/profile_manager.h" |   12 #include "chrome/browser/profiles/profile_manager.h" | 
|   13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |   13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 
|   14 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |   14 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 
|   15 #include "chrome/browser/ui/browser.h" |   15 #include "chrome/browser/ui/browser.h" | 
|   16 #include "chrome/browser/ui/browser_list.h" |   16 #include "chrome/browser/ui/browser_list.h" | 
|   17 #include "chrome/browser/ui/browser_tabstrip.h" |   17 #include "chrome/browser/ui/browser_tabstrip.h" | 
|   18 #include "chrome/browser/ui/browser_window.h" |   18 #include "chrome/browser/ui/browser_window.h" | 
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   71       } |   71       } | 
|   72     } |   72     } | 
|   73   } |   73   } | 
|   74  |   74  | 
|   75   // Hide settings window shelf items not associated with this profile and |   75   // Hide settings window shelf items not associated with this profile and | 
|   76   // restore items for windows associated with the current profile. |   76   // restore items for windows associated with the current profile. | 
|   77   for (Browser* browser : *browser_list) { |   77   for (Browser* browser : *browser_list) { | 
|   78     if (chrome::SettingsWindowManager::GetInstance()->IsSettingsBrowser( |   78     if (chrome::SettingsWindowManager::GetInstance()->IsSettingsBrowser( | 
|   79             browser)) { |   79             browser)) { | 
|   80       aura::Window* aura_window = browser->window()->GetNativeWindow(); |   80       aura::Window* aura_window = browser->window()->GetNativeWindow(); | 
|   81       ash::WmWindowAura::Get(aura_window) |   81       ash::WmWindow::Get(aura_window) | 
|   82           ->SetIntProperty( |   82           ->SetIntProperty( | 
|   83               ash::WmWindowProperty::SHELF_ITEM_TYPE, |   83               ash::WmWindowProperty::SHELF_ITEM_TYPE, | 
|   84               multi_user_util::IsProfileFromActiveUser(browser->profile()) |   84               multi_user_util::IsProfileFromActiveUser(browser->profile()) | 
|   85                   ? ash::TYPE_DIALOG |   85                   ? ash::TYPE_DIALOG | 
|   86                   : ash::TYPE_UNDEFINED); |   86                   : ash::TYPE_UNDEFINED); | 
|   87     } |   87     } | 
|   88   } |   88   } | 
|   89  |   89  | 
|   90   // Update the browser state since some of the removals / adds above might have |   90   // Update the browser state since some of the removals / adds above might have | 
|   91   // had an impact on the browser item. |   91   // had an impact on the browser item. | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  124  |  124  | 
|  125 void MultiProfileBrowserStatusMonitor::DisconnectV1AppFromLauncher( |  125 void MultiProfileBrowserStatusMonitor::DisconnectV1AppFromLauncher( | 
|  126     Browser* browser) { |  126     Browser* browser) { | 
|  127   // Removing a V1 app from the launcher requires to remove the content and |  127   // Removing a V1 app from the launcher requires to remove the content and | 
|  128   // the launcher item. |  128   // the launcher item. | 
|  129   launcher_controller_->UpdateAppState( |  129   launcher_controller_->UpdateAppState( | 
|  130       browser->tab_strip_model()->GetActiveWebContents(), |  130       browser->tab_strip_model()->GetActiveWebContents(), | 
|  131       ChromeLauncherController::APP_STATE_REMOVED); |  131       ChromeLauncherController::APP_STATE_REMOVED); | 
|  132   BrowserStatusMonitor::RemoveV1AppFromShelf(browser); |  132   BrowserStatusMonitor::RemoveV1AppFromShelf(browser); | 
|  133 } |  133 } | 
| OLD | NEW |