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

Side by Side Diff: extensions/components/native_app_window/native_app_window_views.cc

Issue 2551773002: MacViews: Exploring removal of window-modal sheets.
Patch Set: Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/components/native_app_window/native_app_window_views.h" 5 #include "extensions/components/native_app_window/native_app_window_views.h"
6 6
7 #include "base/threading/sequenced_worker_pool.h" 7 #include "base/threading/sequenced_worker_pool.h"
8 #include "content/public/browser/render_view_host.h" 8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/render_widget_host.h" 9 #include "content/public/browser/render_widget_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 gfx::NativeView NativeAppWindowViews::GetHostView() const { 173 gfx::NativeView NativeAppWindowViews::GetHostView() const {
174 return widget_->GetNativeView(); 174 return widget_->GetNativeView();
175 } 175 }
176 176
177 gfx::Point NativeAppWindowViews::GetDialogPosition(const gfx::Size& size) { 177 gfx::Point NativeAppWindowViews::GetDialogPosition(const gfx::Size& size) {
178 gfx::Size app_window_size = widget_->GetWindowBoundsInScreen().size(); 178 gfx::Size app_window_size = widget_->GetWindowBoundsInScreen().size();
179 return gfx::Point(app_window_size.width() / 2 - size.width() / 2, 179 return gfx::Point(app_window_size.width() / 2 - size.width() / 2,
180 app_window_size.height() / 2 - size.height() / 2); 180 app_window_size.height() / 2 - size.height() / 2);
181 } 181 }
182 182
183 gfx::Point NativeAppWindowViews::GetHostPosition() const {
184 return widget_->GetClientAreaBoundsInScreen().origin();
185 }
186
183 gfx::Size NativeAppWindowViews::GetMaximumDialogSize() { 187 gfx::Size NativeAppWindowViews::GetMaximumDialogSize() {
184 return widget_->GetWindowBoundsInScreen().size(); 188 return widget_->GetWindowBoundsInScreen().size();
185 } 189 }
186 190
187 void NativeAppWindowViews::AddObserver( 191 void NativeAppWindowViews::AddObserver(
188 web_modal::ModalDialogHostObserver* observer) { 192 web_modal::ModalDialogHostObserver* observer) {
189 observer_list_.AddObserver(observer); 193 observer_list_.AddObserver(observer);
190 } 194 }
191 void NativeAppWindowViews::RemoveObserver( 195 void NativeAppWindowViews::RemoveObserver(
192 web_modal::ModalDialogHostObserver* observer) { 196 web_modal::ModalDialogHostObserver* observer) {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 437
434 bool NativeAppWindowViews::CanHaveAlphaEnabled() const { 438 bool NativeAppWindowViews::CanHaveAlphaEnabled() const {
435 return widget_->IsTranslucentWindowOpacitySupported(); 439 return widget_->IsTranslucentWindowOpacitySupported();
436 } 440 }
437 441
438 void NativeAppWindowViews::SetVisibleOnAllWorkspaces(bool always_visible) { 442 void NativeAppWindowViews::SetVisibleOnAllWorkspaces(bool always_visible) {
439 widget_->SetVisibleOnAllWorkspaces(always_visible); 443 widget_->SetVisibleOnAllWorkspaces(always_visible);
440 } 444 }
441 445
442 } // namespace native_app_window 446 } // namespace native_app_window
OLDNEW
« no previous file with comments | « extensions/components/native_app_window/native_app_window_views.h ('k') | ui/views/widget/native_widget_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698