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

Side by Side Diff: ash/common/shelf/shelf_widget.cc

Issue 2583393002: Send notification to users upon receiving sms messages (Closed)
Patch Set: update return type Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/common/system/chromeos/network/sms_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "ash/common/shelf/shelf_widget.h" 5 #include "ash/common/shelf/shelf_widget.h"
6 6
7 #include "ash/common/focus_cycler.h" 7 #include "ash/common/focus_cycler.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/app_list_button.h" 10 #include "ash/common/shelf/app_list_button.h"
11 #include "ash/common/shelf/shelf_background_animator_observer.h" 11 #include "ash/common/shelf/shelf_background_animator_observer.h"
12 #include "ash/common/shelf/shelf_constants.h" 12 #include "ash/common/shelf/shelf_constants.h"
13 #include "ash/common/shelf/shelf_delegate.h" 13 #include "ash/common/shelf/shelf_delegate.h"
14 #include "ash/common/shelf/shelf_layout_manager.h" 14 #include "ash/common/shelf/shelf_layout_manager.h"
15 #include "ash/common/shelf/shelf_view.h" 15 #include "ash/common/shelf/shelf_view.h"
16 #include "ash/common/shelf/wm_shelf.h" 16 #include "ash/common/shelf/wm_shelf.h"
17 #include "ash/common/shelf/wm_shelf_util.h" 17 #include "ash/common/shelf/wm_shelf_util.h"
18 #include "ash/common/system/chromeos/network/sms_observer.h"
18 #include "ash/common/system/status_area_layout_manager.h" 19 #include "ash/common/system/status_area_layout_manager.h"
19 #include "ash/common/system/status_area_widget.h" 20 #include "ash/common/system/status_area_widget.h"
20 #include "ash/common/wm_lookup.h" 21 #include "ash/common/wm_lookup.h"
21 #include "ash/common/wm_shell.h" 22 #include "ash/common/wm_shell.h"
22 #include "ash/common/wm_window.h" 23 #include "ash/common/wm_window.h"
23 #include "ash/common/wm_window_property.h" 24 #include "ash/common/wm_window_property.h"
24 #include "ash/root_window_controller.h" 25 #include "ash/root_window_controller.h"
25 #include "base/memory/ptr_util.h" 26 #include "base/memory/ptr_util.h"
26 #include "grit/ash_resources.h" 27 #include "grit/ash_resources.h"
27 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 ShelfWidget::ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf) 217 ShelfWidget::ShelfWidget(WmWindow* shelf_container, WmShelf* wm_shelf)
217 : wm_shelf_(wm_shelf), 218 : wm_shelf_(wm_shelf),
218 status_area_widget_(nullptr), 219 status_area_widget_(nullptr),
219 delegate_view_(new DelegateView(wm_shelf, this)), 220 delegate_view_(new DelegateView(wm_shelf, this)),
220 shelf_view_(nullptr), 221 shelf_view_(nullptr),
221 background_animator_(SHELF_BACKGROUND_DEFAULT, wm_shelf_), 222 background_animator_(SHELF_BACKGROUND_DEFAULT, wm_shelf_),
222 activating_as_fallback_(false) { 223 activating_as_fallback_(false) {
223 DCHECK(wm_shelf_); 224 DCHECK(wm_shelf_);
224 background_animator_.AddObserver(this); 225 background_animator_.AddObserver(this);
225 background_animator_.AddObserver(delegate_view_); 226 background_animator_.AddObserver(delegate_view_);
227 sms_observer_.reset(new SmsObserver());
226 228
227 views::Widget::InitParams params( 229 views::Widget::InitParams params(
228 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 230 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
229 params.name = "ShelfWidget"; 231 params.name = "ShelfWidget";
230 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 232 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
231 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 233 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
232 params.delegate = delegate_view_; 234 params.delegate = delegate_view_;
233 shelf_container->GetRootWindowController() 235 shelf_container->GetRootWindowController()
234 ->ConfigureWidgetInitParamsForContainer( 236 ->ConfigureWidgetInitParamsForContainer(
235 this, shelf_container->GetShellWindowId(), &params); 237 this, shelf_container->GetShellWindowId(), &params);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // access it later in shutdown. 377 // access it later in shutdown.
376 if (shelf_layout_manager_) 378 if (shelf_layout_manager_)
377 shelf_layout_manager_->PrepareForShutdown(); 379 shelf_layout_manager_->PrepareForShutdown();
378 380
379 if (status_area_widget_) { 381 if (status_area_widget_) {
380 background_animator_.RemoveObserver(status_area_widget_); 382 background_animator_.RemoveObserver(status_area_widget_);
381 WmShell::Get()->focus_cycler()->RemoveWidget(status_area_widget_); 383 WmShell::Get()->focus_cycler()->RemoveWidget(status_area_widget_);
382 status_area_widget_->Shutdown(); 384 status_area_widget_->Shutdown();
383 status_area_widget_ = nullptr; 385 status_area_widget_ = nullptr;
384 } 386 }
385
386 CloseNow(); 387 CloseNow();
387 } 388 }
388 389
389 void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) { 390 void ShelfWidget::UpdateIconPositionForPanel(WmWindow* panel) {
390 if (!shelf_view_) 391 if (!shelf_view_)
391 return; 392 return;
392 393
393 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(this); 394 WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(this);
394 shelf_view_->UpdatePanelIconPosition( 395 shelf_view_->UpdatePanelIconPosition(
395 panel->GetIntProperty(WmWindowProperty::SHELF_ID), 396 panel->GetIntProperty(WmWindowProperty::SHELF_ID),
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (shelf_view_) 435 if (shelf_view_)
435 shelf_view_->UpdateShelfItemBackground(alpha); 436 shelf_view_->UpdateShelfItemBackground(alpha);
436 } 437 }
437 438
438 void ShelfWidget::WillDeleteShelfLayoutManager() { 439 void ShelfWidget::WillDeleteShelfLayoutManager() {
439 shelf_layout_manager_->RemoveObserver(this); 440 shelf_layout_manager_->RemoveObserver(this);
440 shelf_layout_manager_ = nullptr; 441 shelf_layout_manager_ = nullptr;
441 } 442 }
442 443
443 } // namespace ash 444 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_widget.h ('k') | ash/common/system/chromeos/network/sms_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698