diff options
8 files changed, 28 insertions, 10 deletions
diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd index 1e27536..b9f267e 100644 --- a/ash/resources/ash_resources.grd +++ b/ash/resources/ash_resources.grd @@ -58,6 +58,8 @@ <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_ICON_APPLIST_PUSHED" file="common/launcher/launcher_appmenu_pressed.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_INCOGNITO_BROWSER" file="common/launcher/launcher_incognito_browser.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_INCOGNITO_BROWSER_PANEL" file="common/launcher/launcher_incognito_browser_panel.png" /> + <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_LIST_BROWSER" file="common/launcher/window_switcher_icon_normal.png" /> + <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_LIST_INCOGNITO_BROWSER" file="common/launcher/window_switcher_icon_incognito.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_OVERFLOW" file="common/launcher/launcher_overflow.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_UNDERLINE_ACTIVE" file="common/launcher/launcher_underline_bottom_active.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_LAUNCHER_UNDERLINE_HOVER" file="common/launcher/launcher_underline_bottom_hover.png" /> diff --git a/ui/resources/default_100_percent/common/window_switcher_icon_incognito.png b/ash/resources/default_100_percent/common/launcher/window_switcher_icon_incognito.png Binary files differindex c095947..c095947 100644 --- a/ui/resources/default_100_percent/common/window_switcher_icon_incognito.png +++ b/ash/resources/default_100_percent/common/launcher/window_switcher_icon_incognito.png diff --git a/ui/resources/default_100_percent/common/window_switcher_icon_normal.png b/ash/resources/default_100_percent/common/launcher/window_switcher_icon_normal.png Binary files differindex e0e91b0..e0e91b0 100644 --- a/ui/resources/default_100_percent/common/window_switcher_icon_normal.png +++ b/ash/resources/default_100_percent/common/launcher/window_switcher_icon_normal.png diff --git a/ui/resources/default_200_percent/common/window_switcher_icon_incognito.png b/ash/resources/default_200_percent/common/launcher/window_switcher_icon_incognito.png Binary files differindex 5759b27..5759b27 100644 --- a/ui/resources/default_200_percent/common/window_switcher_icon_incognito.png +++ b/ash/resources/default_200_percent/common/launcher/window_switcher_icon_incognito.png diff --git a/ui/resources/default_200_percent/common/window_switcher_icon_normal.png b/ash/resources/default_200_percent/common/launcher/window_switcher_icon_normal.png Binary files differindex 46e58a7..46e58a7 100644 --- a/ui/resources/default_200_percent/common/window_switcher_icon_normal.png +++ b/ash/resources/default_200_percent/common/launcher/window_switcher_icon_normal.png diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc index 3e11e50..a20c7e1 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc @@ -1098,17 +1098,23 @@ bool ChromeLauncherControllerPerApp::IsWebContentHandledByApplication( gfx::Image ChromeLauncherControllerPerApp::GetAppListIcon( content::WebContents* web_contents) const { - const Profile* profile = - Profile::FromBrowserContext(web_contents->GetBrowserContext()); - if (profile->IsOffTheRecord() && !profile->IsGuestSession()) { + if (IsIncognito(web_contents)) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - return rb.GetImageNamed(IDR_AURA_LAUNCHER_INCOGNITO_BROWSER); + return rb.GetImageNamed(IDR_AURA_LAUNCHER_LIST_INCOGNITO_BROWSER); } FaviconTabHelper* favicon_tab_helper = FaviconTabHelper::FromWebContents(web_contents); return favicon_tab_helper->GetFavicon(); } +gfx::Image ChromeLauncherControllerPerApp::GetBrowserListIcon( + content::WebContents* web_contents) const { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + return rb.GetImageNamed(IsIncognito(web_contents) ? + IDR_AURA_LAUNCHER_LIST_INCOGNITO_BROWSER : + IDR_AURA_LAUNCHER_LIST_BROWSER); +} + void ChromeLauncherControllerPerApp::OnBrowserRemoved(Browser* browser) { // When called by a unit test it is possible that there is no shell. // In that case, the following function should not get called. @@ -1477,7 +1483,7 @@ ChromeLauncherControllerPerApp::GetBrowserApplicationList( if (!(event_flags & ui::EF_SHIFT_DOWN)) { WebContents* web_contents = tab_strip->GetWebContentsAt(tab_strip->active_index()); - gfx::Image app_icon = GetAppListIcon(web_contents); + gfx::Image app_icon = GetBrowserListIcon(web_contents); items.push_back(new ChromeLauncherAppMenuItemBrowser( web_contents->GetTitle(), app_icon.IsEmpty() ? NULL : &app_icon, @@ -1514,3 +1520,10 @@ bool ChromeLauncherControllerPerApp::IsBrowserRepresentedInBrowserList( GetLauncherIDForAppID(web_app::GetExtensionIdFromApplicationName( browser->app_name())) <= 0)); } + +bool ChromeLauncherControllerPerApp::IsIncognito( + content::WebContents* web_contents) const { + const Profile* profile = + Profile::FromBrowserContext(web_contents->GetBrowserContext()); + return profile->IsOffTheRecord() && !profile->IsGuestSession(); +} diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h index 13d4e99..5c5a7c5 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h @@ -308,10 +308,14 @@ class ChromeLauncherControllerPerApp : public ash::LauncherModelObserver, bool IsWebContentHandledByApplication(content::WebContents* web_contents, const std::string& app_id); - // Get the favicon for the application list by giving the |web_content|. + // Get the favicon for the application list by giving the |web_contents|. // Note that for incognito windows the incognito icon will be returned. gfx::Image GetAppListIcon(content::WebContents* web_contents) const; + // Get the favicon for the browser list by giving the |web_contents|. + // Note that for incognito windows the incognito icon will be returned. + gfx::Image GetBrowserListIcon(content::WebContents* web_contents) const; + // Overridden from chrome::BrowserListObserver. virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; @@ -409,6 +413,9 @@ class ChromeLauncherControllerPerApp : public ash::LauncherModelObserver, // list. bool IsBrowserRepresentedInBrowserList(Browser* browser); + // Check if the given |web_contents| is in incognito mode. + bool IsIncognito(content::WebContents* web_contents) const; + ash::LauncherModel* model_; // Profile used for prefs and loading extensions. This is NOT necessarily the diff --git a/ui/resources/ui_resources.grd b/ui/resources/ui_resources.grd index 805784e..35a932c 100644 --- a/ui/resources/ui_resources.grd +++ b/ui/resources/ui_resources.grd @@ -165,10 +165,6 @@ <structure type="chrome_scaled_image" name="IDR_FRAME" file="frame_default.png" /> <structure type="chrome_scaled_image" name="IDR_FRAME_APP_PANEL" file="frame_app_panel_default.png" /> <structure type="chrome_scaled_image" name="IDR_FRAME_INACTIVE" file="frame_default_inactive.png" /> - <if expr="pp_ifdef('use_ash')"> - <structure type="chrome_scaled_image" name="IDR_LAUNCHER_BROWSER" file="common/window_switcher_icon_normal.png" /> - <structure type="chrome_scaled_image" name="IDR_LAUNCHER_INCOGNITO_BROWSER" file="common/window_switcher_icon_incognito.png" /> - </if> <if expr="not pp_ifdef('toolkit_views') and is_posix and not is_macosx"> <structure type="chrome_scaled_image" name="IDR_MAXIMIZE" file="linux/linux_maximize.png" /> <structure type="chrome_scaled_image" name="IDR_MAXIMIZE_H" file="linux/linux_maximize_hover.png" /> |