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

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

Issue 294963004: Revert of 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
« no previous file with comments | « ash/shell/window_watcher.cc ('k') | ash/touch/touch_hud_debug.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 (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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 Shell::GetInstance()->RemoveShellObserver(this); 151 Shell::GetInstance()->RemoveShellObserver(this);
152 if (shelf_) 152 if (shelf_)
153 shelf_->RemoveObserver(this); 153 shelf_->RemoveObserver(this);
154 collection_ = NULL; 154 collection_ = NULL;
155 shelf_ = NULL; 155 shelf_ = NULL;
156 } 156 }
157 157
158 void WorkAreaObserver::OnDisplayWorkAreaInsetsChanged() { 158 void WorkAreaObserver::OnDisplayWorkAreaInsetsChanged() {
159 UpdateShelf(); 159 UpdateShelf();
160 160
161 collection_->OnDisplayMetricsChanged( 161 collection_->OnDisplayBoundsChanged(
162 Shell::GetScreen()->GetDisplayNearestWindow( 162 Shell::GetScreen()->GetDisplayNearestWindow(
163 shelf_->shelf_widget()->GetNativeView()), 163 shelf_->shelf_widget()->GetNativeView()));
164 gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA);
165 } 164 }
166 165
167 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { 166 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) {
168 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( 167 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
169 shelf_->shelf_widget()->GetNativeView()); 168 shelf_->shelf_widget()->GetNativeView());
170 gfx::Rect work_area = display.work_area(); 169 gfx::Rect work_area = display.work_area();
171 int width = 0; 170 int width = 0;
172 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && 171 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) &&
173 new_state == SHELF_AUTO_HIDE_SHOWN) { 172 new_state == SHELF_AUTO_HIDE_SHOWN) {
174 // 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
613 612
614 message_center::MessageCenterBubble* 613 message_center::MessageCenterBubble*
615 WebNotificationTray::GetMessageCenterBubbleForTest() { 614 WebNotificationTray::GetMessageCenterBubbleForTest() {
616 if (!message_center_bubble()) 615 if (!message_center_bubble())
617 return NULL; 616 return NULL;
618 return static_cast<message_center::MessageCenterBubble*>( 617 return static_cast<message_center::MessageCenterBubble*>(
619 message_center_bubble()->bubble()); 618 message_center_bubble()->bubble());
620 } 619 }
621 620
622 } // namespace ash 621 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_watcher.cc ('k') | ash/touch/touch_hud_debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698