| 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/browser_status_monitor.h" | 5 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_util.h" | 7 #include "ash/shelf/shelf_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" | 11 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll
er.h" |
| 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 13 #include "chrome/browser/ui/ash/launcher/launcher_item_util.h" | |
| 14 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 18 #include "chrome/browser/ui/settings_window_manager.h" | 17 #include "chrome/browser/ui/settings_window_manager.h" |
| 19 #include "chrome/browser/ui/settings_window_manager_observer.h" | 18 #include "chrome/browser/ui/settings_window_manager_observer.h" |
| 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 21 #include "chrome/browser/web_applications/web_app.h" | 20 #include "chrome/browser/web_applications/web_app.h" |
| 22 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Observes any new settings windows and sets their shelf icon (since they | 75 // Observes any new settings windows and sets their shelf icon (since they |
| 77 // are excluded from BrowserShortcutLauncherItem). | 76 // are excluded from BrowserShortcutLauncherItem). |
| 78 class BrowserStatusMonitor::SettingsWindowObserver | 77 class BrowserStatusMonitor::SettingsWindowObserver |
| 79 : public chrome::SettingsWindowManagerObserver { | 78 : public chrome::SettingsWindowManagerObserver { |
| 80 public: | 79 public: |
| 81 SettingsWindowObserver() {} | 80 SettingsWindowObserver() {} |
| 82 virtual ~SettingsWindowObserver() {} | 81 virtual ~SettingsWindowObserver() {} |
| 83 | 82 |
| 84 // SettingsWindowManagerObserver | 83 // SettingsWindowManagerObserver |
| 85 virtual void OnNewSettingsWindow(Browser* settings_browser) OVERRIDE { | 84 virtual void OnNewSettingsWindow(Browser* settings_browser) OVERRIDE { |
| 86 CreateShelfItemForDialog(IDR_ASH_SHELF_ICON_SETTINGS, | 85 ash::SetShelfItemDetailsForDialogWindow( |
| 87 settings_browser->window()->GetNativeWindow()); | 86 settings_browser->window()->GetNativeWindow(), |
| 87 IDR_ASH_SHELF_ICON_SETTINGS); |
| 88 } | 88 } |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 DISALLOW_COPY_AND_ASSIGN(SettingsWindowObserver); | 91 DISALLOW_COPY_AND_ASSIGN(SettingsWindowObserver); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 BrowserStatusMonitor::BrowserStatusMonitor( | 94 BrowserStatusMonitor::BrowserStatusMonitor( |
| 95 ChromeLauncherController* launcher_controller) | 95 ChromeLauncherController* launcher_controller) |
| 96 : launcher_controller_(launcher_controller), | 96 : launcher_controller_(launcher_controller), |
| 97 observed_activation_clients_(this), | 97 observed_activation_clients_(this), |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 content::WebContents* contents) { | 381 content::WebContents* contents) { |
| 382 return launcher_controller_->GetShelfIDForWebContents(contents); | 382 return launcher_controller_->GetShelfIDForWebContents(contents); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( | 385 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( |
| 386 Browser* browser, | 386 Browser* browser, |
| 387 content::WebContents* web_contents) { | 387 content::WebContents* web_contents) { |
| 388 launcher_controller_->GetBrowserShortcutLauncherItemController()-> | 388 launcher_controller_->GetBrowserShortcutLauncherItemController()-> |
| 389 SetShelfIDForBrowserWindowContents(browser, web_contents); | 389 SetShelfIDForBrowserWindowContents(browser, web_contents); |
| 390 } | 390 } |
| OLD | NEW |