Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: ash/launcher/tabbed_launcher_button.cc

Issue 9649013: Show a different icon in the launcher for incognito windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-upload Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/launcher/tabbed_launcher_button.h ('k') | ash/shell/shell_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/tabbed_launcher_button.cc
diff --git a/ash/launcher/tabbed_launcher_button.cc b/ash/launcher/tabbed_launcher_button.cc
index e3f72866dbaa9dfb4e3ae1ede5fb423fea5dc449..17a11d1d069373afc676d134c9131181347efd20 100644
--- a/ash/launcher/tabbed_launcher_button.cc
+++ b/ash/launcher/tabbed_launcher_button.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "ash/launcher/launcher_button_host.h"
+#include "ash/launcher/launcher_types.h"
#include "grit/ui_resources.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/animation/multi_animation.h"
@@ -18,7 +19,9 @@
namespace ash {
namespace internal {
-TabbedLauncherButton::IconView::IconView(TabbedLauncherButton* host)
+TabbedLauncherButton::IconView::IconView(
+ TabbedLauncherButton* host,
+ TabbedLauncherButton::IncognitoState is_incognito)
: host_(host),
show_image_(true) {
if (!browser_image_) {
@@ -26,11 +29,19 @@ TabbedLauncherButton::IconView::IconView(TabbedLauncherButton* host)
browser_image_ = new SkBitmap(
*rb.GetImageNamed(IDR_AURA_LAUNCHER_BROWSER).ToSkBitmap());
+ incognito_browser_image_ = new SkBitmap(
+ *rb.GetImageNamed(IDR_AURA_LAUNCHER_INCOGNITO_BROWSER).ToSkBitmap());
browser_panel_image_ = new SkBitmap(
*rb.GetImageNamed(IDR_AURA_LAUNCHER_BROWSER_PANEL).ToSkBitmap());
+ incognito_browser_panel_image_ = new SkBitmap(
+ *rb.GetImageNamed(
+ IDR_AURA_LAUNCHER_INCOGNITO_BROWSER_PANEL).ToSkBitmap());
}
set_icon_size(0);
- LauncherButton::IconView::SetImage(*browser_image_);
+ if (is_incognito == STATE_NOT_INCOGNITO)
+ LauncherButton::IconView::SetImage(*browser_image_);
+ else
+ LauncherButton::IconView::SetImage(*incognito_browser_image_);
}
TabbedLauncherButton::IconView::~IconView() {
@@ -92,19 +103,25 @@ void TabbedLauncherButton::IconView::OnPaint(gfx::Canvas* canvas) {
// static
SkBitmap* TabbedLauncherButton::IconView::browser_image_ = NULL;
+SkBitmap* TabbedLauncherButton::IconView::incognito_browser_image_ = NULL;
SkBitmap* TabbedLauncherButton::IconView::browser_panel_image_ = NULL;
+SkBitmap* TabbedLauncherButton::IconView::incognito_browser_panel_image_ = NULL;
TabbedLauncherButton* TabbedLauncherButton::Create(
views::ButtonListener* listener,
- LauncherButtonHost* host) {
- TabbedLauncherButton* button = new TabbedLauncherButton(listener, host);
+ LauncherButtonHost* host,
+ IncognitoState is_incognito) {
+ TabbedLauncherButton* button =
+ new TabbedLauncherButton(listener, host, is_incognito);
button->Init();
return button;
}
TabbedLauncherButton::TabbedLauncherButton(views::ButtonListener* listener,
- LauncherButtonHost* host)
- : LauncherButton(listener, host) {
+ LauncherButtonHost* host,
+ IncognitoState is_incognito)
+ : LauncherButton(listener, host),
+ is_incognito_(is_incognito) {
set_accessibility_focusable(true);
}
@@ -125,7 +142,7 @@ void TabbedLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) {
}
LauncherButton::IconView* TabbedLauncherButton::CreateIconView() {
- return new IconView(this);
+ return new IconView(this, is_incognito_);
}
} // namespace internal
« no previous file with comments | « ash/launcher/tabbed_launcher_button.h ('k') | ash/shell/shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698