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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 259253002: Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_layout_manager_observer.h" 10 #include "ash/shelf/shelf_layout_manager_observer.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 Shell::GetInstance()->RemoveShellObserver(this); 150 Shell::GetInstance()->RemoveShellObserver(this);
151 if (shelf_) 151 if (shelf_)
152 shelf_->RemoveObserver(this); 152 shelf_->RemoveObserver(this);
153 collection_ = NULL; 153 collection_ = NULL;
154 shelf_ = NULL; 154 shelf_ = NULL;
155 } 155 }
156 156
157 void WorkAreaObserver::OnDisplayWorkAreaInsetsChanged() { 157 void WorkAreaObserver::OnDisplayWorkAreaInsetsChanged() {
158 UpdateShelf(); 158 UpdateShelf();
159 159
160 collection_->OnDisplayBoundsChanged( 160 collection_->OnDisplayMetricsChanged(
161 Shell::GetScreen()->GetDisplayNearestWindow( 161 Shell::GetScreen()->GetDisplayNearestWindow(
162 shelf_->shelf_widget()->GetNativeView())); 162 shelf_->shelf_widget()->GetNativeView()),
163 gfx::DisplayObserver::DISPLAY_METRICS_WORK_AREA);
163 } 164 }
164 165
165 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { 166 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) {
166 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( 167 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
167 shelf_->shelf_widget()->GetNativeView()); 168 shelf_->shelf_widget()->GetNativeView());
168 gfx::Rect work_area = display.work_area(); 169 gfx::Rect work_area = display.work_area();
169 int width = 0; 170 int width = 0;
170 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && 171 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) &&
171 new_state == SHELF_AUTO_HIDE_SHOWN) { 172 new_state == SHELF_AUTO_HIDE_SHOWN) {
172 // Since the work_area is already reduced by kAutoHideSize, the inset width 173 // Since the work_area is already reduced by kAutoHideSize, the inset width
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 612
612 message_center::MessageCenterBubble* 613 message_center::MessageCenterBubble*
613 WebNotificationTray::GetMessageCenterBubbleForTest() { 614 WebNotificationTray::GetMessageCenterBubbleForTest() {
614 if (!message_center_bubble()) 615 if (!message_center_bubble())
615 return NULL; 616 return NULL;
616 return static_cast<message_center::MessageCenterBubble*>( 617 return static_cast<message_center::MessageCenterBubble*>(
617 message_center_bubble()->bubble()); 618 message_center_bubble()->bubble());
618 } 619 }
619 620
620 } // namespace ash 621 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698