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

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
« 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_->OnDisplayBoundsChanged( 161 collection_->OnDisplayMetricsChanged(
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);
164 } 165 }
165 166
166 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { 167 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) {
167 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( 168 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
168 shelf_->shelf_widget()->GetNativeView()); 169 shelf_->shelf_widget()->GetNativeView());
169 gfx::Rect work_area = display.work_area(); 170 gfx::Rect work_area = display.work_area();
170 int width = 0; 171 int width = 0;
171 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && 172 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) &&
172 new_state == SHELF_AUTO_HIDE_SHOWN) { 173 new_state == SHELF_AUTO_HIDE_SHOWN) {
173 // Since the work_area is already reduced by kAutoHideSize, the inset width 174 // Since the work_area is already reduced by kAutoHideSize, the inset width
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 613
613 message_center::MessageCenterBubble* 614 message_center::MessageCenterBubble*
614 WebNotificationTray::GetMessageCenterBubbleForTest() { 615 WebNotificationTray::GetMessageCenterBubbleForTest() {
615 if (!message_center_bubble()) 616 if (!message_center_bubble())
616 return NULL; 617 return NULL;
617 return static_cast<message_center::MessageCenterBubble*>( 618 return static_cast<message_center::MessageCenterBubble*>(
618 message_center_bubble()->bubble()); 619 message_center_bubble()->bubble());
619 } 620 }
620 621
621 } // namespace ash 622 } // 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