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

Unified Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2557593009: Fix Chrome crashes on calling OnTrayVisibilityChange (Closed)
Patch Set: new approach Created 4 years 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/common/system/chromeos/palette/palette_tray.h ('k') | ash/common/system/status_area_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/palette/palette_tray.cc
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc
index 2cfc5b8af776a8d412eed64d2739ccf4990423d4..179be69fd967c0b5e0bbcde240bccb65415f2f16 100644
--- a/ash/common/system/chromeos/palette/palette_tray.cc
+++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -204,13 +204,6 @@ PaletteTray::PaletteTray(WmShelf* wm_shelf)
base::Bind(&PaletteTray::OnStylusStateChanged,
weak_factory_.GetWeakPtr()));
}
-
- // OnPaletteEnabledPrefChanged will get called with the initial pref value,
- // which will take care of showing the palette.
- palette_enabled_subscription_ =
- WmShell::Get()->palette_delegate()->AddPaletteEnableListener(
- base::Bind(&PaletteTray::OnPaletteEnabledPrefChanged,
- weak_factory_.GetWeakPtr()));
}
PaletteTray::~PaletteTray() {
@@ -413,6 +406,15 @@ void PaletteTray::AnchorUpdated() {
bubble_->bubble_view()->UpdateBubble();
}
+void PaletteTray::Initialize() {
+ // OnPaletteEnabledPrefChanged will get called with the initial pref value,
+ // which will take care of showing the palette.
+ palette_enabled_subscription_ =
+ WmShell::Get()->palette_delegate()->AddPaletteEnableListener(
+ base::Bind(&PaletteTray::OnPaletteEnabledPrefChanged,
+ weak_factory_.GetWeakPtr()));
+}
+
void PaletteTray::SetIconBorderForShelfAlignment() {
// TODO(tdanderson): Ensure PaletteTray follows material design specs. See
// crbug.com/630464.
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tray.h ('k') | ash/common/system/status_area_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698