OLD | NEW |
---|---|
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 "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
8 #include "ash/ash_constants.h" | 8 #include "ash/ash_constants.h" |
9 #include "ash/frame/custom_frame_view_ash.h" | 9 #include "ash/frame/custom_frame_view_ash.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 init_params, | 167 init_params, |
168 widget); | 168 widget); |
169 | 169 |
170 if (ash::Shell::HasInstance() && use_default_bounds) { | 170 if (ash::Shell::HasInstance() && use_default_bounds) { |
171 // Open a new panel on the target root. | 171 // Open a new panel on the target root. |
172 init_params->bounds = ash::ScreenUtil::ConvertRectToScreen( | 172 init_params->bounds = ash::ScreenUtil::ConvertRectToScreen( |
173 ash::Shell::GetTargetRootWindow(), gfx::Rect(GetPreferredSize())); | 173 ash::Shell::GetTargetRootWindow(), gfx::Rect(GetPreferredSize())); |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 apps::AppWindowFrameView* | 177 views::NonClientFrameView* |
178 ChromeNativeAppWindowViewsAura::CreateNonStandardAppFrame() { | 178 ChromeNativeAppWindowViewsAura::CreateNonStandardAppFrame() { |
179 apps::AppWindowFrameView* frame = | 179 apps::AppWindowFrameView* frame = static_cast<apps::AppWindowFrameView*>( |
tapted
2015/05/14 04:23:50
This isn't so nice.. What about making ChromeNativ
jackhou1
2015/05/14 06:20:40
Done.
| |
180 ChromeNativeAppWindowViews::CreateNonStandardAppFrame(); | 180 ChromeNativeAppWindowViews::CreateNonStandardAppFrame()); |
181 | 181 |
182 // For Aura windows on the Ash desktop the sizes are different and the user | 182 // For Aura windows on the Ash desktop the sizes are different and the user |
183 // can resize the window from slightly outside the bounds as well. | 183 // can resize the window from slightly outside the bounds as well. |
184 if (chrome::IsNativeWindowInAsh(widget()->GetNativeWindow())) { | 184 if (chrome::IsNativeWindowInAsh(widget()->GetNativeWindow())) { |
185 frame->SetResizeSizes(ash::kResizeInsideBoundsSize, | 185 frame->SetResizeSizes(ash::kResizeInsideBoundsSize, |
186 ash::kResizeOutsideBoundsSize, | 186 ash::kResizeOutsideBoundsSize, |
187 ash::kResizeAreaCornerSize); | 187 ash::kResizeAreaCornerSize); |
188 } | 188 } |
189 | 189 |
190 #if !defined(OS_CHROMEOS) | 190 #if !defined(OS_CHROMEOS) |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
367 ChromeNativeAppWindowViews::UpdateShape(region.Pass()); | 367 ChromeNativeAppWindowViews::UpdateShape(region.Pass()); |
368 | 368 |
369 aura::Window* native_window = widget()->GetNativeWindow(); | 369 aura::Window* native_window = widget()->GetNativeWindow(); |
370 if (shape() && !had_shape) { | 370 if (shape() && !had_shape) { |
371 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 371 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
372 new ShapedAppWindowTargeter(native_window, this))); | 372 new ShapedAppWindowTargeter(native_window, this))); |
373 } else if (!shape() && had_shape) { | 373 } else if (!shape() && had_shape) { |
374 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); | 374 native_window->SetEventTargeter(scoped_ptr<ui::EventTargeter>()); |
375 } | 375 } |
376 } | 376 } |
OLD | NEW |