OLD | NEW |
---|---|
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 "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" | 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/window_properties.h" | 9 #include "ash/wm/window_properties.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 ImmersiveModeControllerAsh::ImmersiveModeControllerAsh() | 281 ImmersiveModeControllerAsh::ImmersiveModeControllerAsh() |
282 : delegate_(NULL), | 282 : delegate_(NULL), |
283 widget_(NULL), | 283 widget_(NULL), |
284 top_container_(NULL), | 284 top_container_(NULL), |
285 observers_enabled_(false), | 285 observers_enabled_(false), |
286 enabled_(false), | 286 enabled_(false), |
287 reveal_state_(CLOSED), | 287 reveal_state_(CLOSED), |
288 revealed_lock_count_(0), | 288 revealed_lock_count_(0), |
289 tab_indicator_visibility_(TAB_INDICATORS_HIDE), | 289 tab_indicator_visibility_(TAB_INDICATORS_HIDE), |
290 mouse_x_when_hit_top_(-1), | 290 mouse_x_when_hit_top_(-1), |
291 gesture_begun_(false), | |
291 native_window_(NULL), | 292 native_window_(NULL), |
292 animation_(new ui::SlideAnimation(this)), | 293 animation_(new ui::SlideAnimation(this)), |
293 animations_disabled_for_test_(false), | 294 animations_disabled_for_test_(false), |
294 weak_ptr_factory_(this), | 295 weak_ptr_factory_(this) { |
295 gesture_begun_(false) { | |
296 } | 296 } |
297 | 297 |
298 ImmersiveModeControllerAsh::~ImmersiveModeControllerAsh() { | 298 ImmersiveModeControllerAsh::~ImmersiveModeControllerAsh() { |
299 // The browser view is being destroyed so there's no need to update its | 299 // The browser view is being destroyed so there's no need to update its |
300 // layout or layers, even if the top views are revealed. But the window | 300 // layout or layers, even if the top views are revealed. But the window |
301 // observers still need to be removed. | 301 // observers still need to be removed. |
302 EnableWindowObservers(false); | 302 EnableWindowObservers(false); |
303 } | 303 } |
304 | 304 |
305 void ImmersiveModeControllerAsh::LockRevealedState( | 305 void ImmersiveModeControllerAsh::LockRevealedState( |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 return; | 927 return; |
928 } | 928 } |
929 // Slide in the reveal view. | 929 // Slide in the reveal view. |
930 if (animate == ANIMATE_NO) { | 930 if (animate == ANIMATE_NO) { |
931 animation_->Reset(1); | 931 animation_->Reset(1); |
932 OnSlideOpenAnimationCompleted(LAYOUT_YES); | 932 OnSlideOpenAnimationCompleted(LAYOUT_YES); |
933 } else { | 933 } else { |
934 animation_->SetSlideDuration(GetAnimationDuration(animate)); | 934 animation_->SetSlideDuration(GetAnimationDuration(animate)); |
935 animation_->Show(); | 935 animation_->Show(); |
936 } | 936 } |
937 | |
938 if (previous_reveal_state == CLOSED) { | |
sky
2013/06/19 13:32:29
nit: no {}
| |
939 FOR_EACH_OBSERVER(Observer, observers_, OnImmersiveRevealStarted()); | |
940 } | |
937 } | 941 } |
938 | 942 |
939 void ImmersiveModeControllerAsh::EnablePaintToLayer(bool enable) { | 943 void ImmersiveModeControllerAsh::EnablePaintToLayer(bool enable) { |
940 top_container_->SetPaintToLayer(enable); | 944 top_container_->SetPaintToLayer(enable); |
941 | 945 |
942 // Views software compositing is not fully layer aware. If the bookmark bar | 946 // Views software compositing is not fully layer aware. If the bookmark bar |
943 // is detached while the top container layer slides on or off the screen, | 947 // is detached while the top container layer slides on or off the screen, |
944 // the pixels that become exposed are the remnants of the last software | 948 // the pixels that become exposed are the remnants of the last software |
945 // composite of the BrowserView, not the freshly-exposed bookmark bar. | 949 // composite of the BrowserView, not the freshly-exposed bookmark bar. |
946 // Force the bookmark bar to paint to a layer so the views composite | 950 // Force the bookmark bar to paint to a layer so the views composite |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 if (!native_window_) | 1064 if (!native_window_) |
1061 return; | 1065 return; |
1062 aura::RootWindow* root_window = native_window_->GetRootWindow(); | 1066 aura::RootWindow* root_window = native_window_->GetRootWindow(); |
1063 if (!root_window) | 1067 if (!root_window) |
1064 return; | 1068 return; |
1065 if (observers_enabled_) | 1069 if (observers_enabled_) |
1066 root_window->AddPreTargetHandler(this); | 1070 root_window->AddPreTargetHandler(this); |
1067 else | 1071 else |
1068 root_window->RemovePreTargetHandler(this); | 1072 root_window->RemovePreTargetHandler(this); |
1069 } | 1073 } |
OLD | NEW |