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/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
16 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
17 #include "chrome/browser/ui/settings_window_manager.h" | 17 #include "chrome/browser/ui/settings_window_manager.h" |
18 #include "chrome/browser/ui/settings_window_manager_observer.h" | 18 #include "chrome/browser/ui/settings_window_manager_observer.h" |
19 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
20 #include "chrome/browser/web_applications/web_app.h" | 20 #include "chrome/browser/web_applications/web_app.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
23 #include "grit/ash_resources.h" | 23 #include "grit/ash_resources.h" |
| 24 #include "grit/generated_resources.h" |
24 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
25 #include "ui/aura/window_event_dispatcher.h" | 26 #include "ui/aura/window_event_dispatcher.h" |
| 27 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
27 #include "ui/wm/public/activation_client.h" | 29 #include "ui/wm/public/activation_client.h" |
28 | 30 |
29 // This class monitors the WebContent of the all tab and notifies a navigation | 31 // This class monitors the WebContent of the all tab and notifies a navigation |
30 // to the BrowserStatusMonitor. | 32 // to the BrowserStatusMonitor. |
31 class BrowserStatusMonitor::LocalWebContentsObserver | 33 class BrowserStatusMonitor::LocalWebContentsObserver |
32 : public content::WebContentsObserver { | 34 : public content::WebContentsObserver { |
33 public: | 35 public: |
34 LocalWebContentsObserver(content::WebContents* contents, | 36 LocalWebContentsObserver(content::WebContents* contents, |
35 BrowserStatusMonitor* monitor) | 37 BrowserStatusMonitor* monitor) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 class BrowserStatusMonitor::SettingsWindowObserver | 79 class BrowserStatusMonitor::SettingsWindowObserver |
78 : public chrome::SettingsWindowManagerObserver { | 80 : public chrome::SettingsWindowManagerObserver { |
79 public: | 81 public: |
80 SettingsWindowObserver() {} | 82 SettingsWindowObserver() {} |
81 virtual ~SettingsWindowObserver() {} | 83 virtual ~SettingsWindowObserver() {} |
82 | 84 |
83 // SettingsWindowManagerObserver | 85 // SettingsWindowManagerObserver |
84 virtual void OnNewSettingsWindow(Browser* settings_browser) OVERRIDE { | 86 virtual void OnNewSettingsWindow(Browser* settings_browser) OVERRIDE { |
85 ash::SetShelfItemDetailsForDialogWindow( | 87 ash::SetShelfItemDetailsForDialogWindow( |
86 settings_browser->window()->GetNativeWindow(), | 88 settings_browser->window()->GetNativeWindow(), |
87 IDR_ASH_SHELF_ICON_SETTINGS); | 89 IDR_ASH_SHELF_ICON_SETTINGS, |
| 90 l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE)); |
88 } | 91 } |
89 | 92 |
90 private: | 93 private: |
91 DISALLOW_COPY_AND_ASSIGN(SettingsWindowObserver); | 94 DISALLOW_COPY_AND_ASSIGN(SettingsWindowObserver); |
92 }; | 95 }; |
93 | 96 |
94 BrowserStatusMonitor::BrowserStatusMonitor( | 97 BrowserStatusMonitor::BrowserStatusMonitor( |
95 ChromeLauncherController* launcher_controller) | 98 ChromeLauncherController* launcher_controller) |
96 : launcher_controller_(launcher_controller), | 99 : launcher_controller_(launcher_controller), |
97 observed_activation_clients_(this), | 100 observed_activation_clients_(this), |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 content::WebContents* contents) { | 384 content::WebContents* contents) { |
382 return launcher_controller_->GetShelfIDForWebContents(contents); | 385 return launcher_controller_->GetShelfIDForWebContents(contents); |
383 } | 386 } |
384 | 387 |
385 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( | 388 void BrowserStatusMonitor::SetShelfIDForBrowserWindowContents( |
386 Browser* browser, | 389 Browser* browser, |
387 content::WebContents* web_contents) { | 390 content::WebContents* web_contents) { |
388 launcher_controller_->GetBrowserShortcutLauncherItemController()-> | 391 launcher_controller_->GetBrowserShortcutLauncherItemController()-> |
389 SetShelfIDForBrowserWindowContents(browser, web_contents); | 392 SetShelfIDForBrowserWindowContents(browser, web_contents); |
390 } | 393 } |
OLD | NEW |