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

Side by Side Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc

Issue 2652043004: Remove persisted docked windows (Closed)
Patch Set: varkha's comments Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/apps/chrome_native_app_window_views_aura.h" 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "apps/ui/views/app_window_frame_view.h" 9 #include "apps/ui/views/app_window_frame_view.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 27 matching lines...) Expand all
38 // are not saved and used to restore windows when they are recreated. 38 // are not saved and used to restore windows when they are recreated.
39 switch (restore_state) { 39 switch (restore_state) {
40 case ui::SHOW_STATE_NORMAL: 40 case ui::SHOW_STATE_NORMAL:
41 case ui::SHOW_STATE_MAXIMIZED: 41 case ui::SHOW_STATE_MAXIMIZED:
42 case ui::SHOW_STATE_FULLSCREEN: 42 case ui::SHOW_STATE_FULLSCREEN:
43 return restore_state; 43 return restore_state;
44 44
45 case ui::SHOW_STATE_DEFAULT: 45 case ui::SHOW_STATE_DEFAULT:
46 case ui::SHOW_STATE_MINIMIZED: 46 case ui::SHOW_STATE_MINIMIZED:
47 case ui::SHOW_STATE_INACTIVE: 47 case ui::SHOW_STATE_INACTIVE:
48 // TODO(afakhry): Remove Docked Windows in M58.
48 case ui::SHOW_STATE_DOCKED: 49 case ui::SHOW_STATE_DOCKED:
49 case ui::SHOW_STATE_END: 50 case ui::SHOW_STATE_END:
50 return ui::SHOW_STATE_NORMAL; 51 return ui::SHOW_STATE_NORMAL;
51 } 52 }
52 53
53 return ui::SHOW_STATE_NORMAL; 54 return ui::SHOW_STATE_NORMAL;
54 } 55 }
55 56
56 void ChromeNativeAppWindowViewsAura::OnBeforeWidgetInit( 57 void ChromeNativeAppWindowViewsAura::OnBeforeWidgetInit(
57 const AppWindow::CreateParams& create_params, 58 const AppWindow::CreateParams& create_params,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // First normal states are checked. 97 // First normal states are checked.
97 if (IsMaximized()) 98 if (IsMaximized())
98 return ui::SHOW_STATE_MAXIMIZED; 99 return ui::SHOW_STATE_MAXIMIZED;
99 if (IsFullscreen()) { 100 if (IsFullscreen()) {
100 return ui::SHOW_STATE_FULLSCREEN; 101 return ui::SHOW_STATE_FULLSCREEN;
101 } 102 }
102 103
103 // Use kPreMinimizedShowStateKey in case a window is minimized/hidden. 104 // Use kPreMinimizedShowStateKey in case a window is minimized/hidden.
104 ui::WindowShowState restore_state = widget()->GetNativeWindow()->GetProperty( 105 ui::WindowShowState restore_state = widget()->GetNativeWindow()->GetProperty(
105 aura::client::kPreMinimizedShowStateKey); 106 aura::client::kPreMinimizedShowStateKey);
107
108 // TODO(afakhry): Remove in M58.
106 if (widget()->GetNativeWindow()->GetProperty(aura::client::kShowStateKey) == 109 if (widget()->GetNativeWindow()->GetProperty(aura::client::kShowStateKey) ==
107 ui::SHOW_STATE_DOCKED || 110 ui::SHOW_STATE_DOCKED ||
108 restore_state == ui::SHOW_STATE_DOCKED) { 111 restore_state == ui::SHOW_STATE_DOCKED) {
109 return ui::SHOW_STATE_DOCKED; 112 return ui::SHOW_STATE_DOCKED;
110 } 113 }
111 114
112 return GetRestorableState(restore_state); 115 return GetRestorableState(restore_state);
113 } 116 }
114 117
115 bool ChromeNativeAppWindowViewsAura::IsAlwaysOnTop() const { 118 bool ChromeNativeAppWindowViewsAura::IsAlwaysOnTop() const {
116 return widget()->IsAlwaysOnTop(); 119 return widget()->IsAlwaysOnTop();
117 } 120 }
118 121
119 void ChromeNativeAppWindowViewsAura::UpdateShape( 122 void ChromeNativeAppWindowViewsAura::UpdateShape(
120 std::unique_ptr<SkRegion> region) { 123 std::unique_ptr<SkRegion> region) {
121 bool had_shape = !!shape(); 124 bool had_shape = !!shape();
122 125
123 ChromeNativeAppWindowViews::UpdateShape(std::move(region)); 126 ChromeNativeAppWindowViews::UpdateShape(std::move(region));
124 127
125 aura::Window* native_window = widget()->GetNativeWindow(); 128 aura::Window* native_window = widget()->GetNativeWindow();
126 if (shape() && !had_shape) { 129 if (shape() && !had_shape) {
127 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( 130 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>(
128 new ShapedAppWindowTargeter(native_window, this))); 131 new ShapedAppWindowTargeter(native_window, this)));
129 } else if (!shape() && had_shape) { 132 } else if (!shape() && had_shape) {
130 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>()); 133 native_window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>());
131 } 134 }
132 } 135 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698