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

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 22903022: Limit constrained windows to the size of the parent view. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No initializer Created 7 years, 3 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 (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 "chrome/browser/extensions/extension_host.h" 5 #include "chrome/browser/extensions/extension_host.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 gfx::Point ExtensionHost::GetDialogPosition(const gfx::Size& size) { 305 gfx::Point ExtensionHost::GetDialogPosition(const gfx::Size& size) {
306 if (!GetVisibleWebContents()) 306 if (!GetVisibleWebContents())
307 return gfx::Point(); 307 return gfx::Point();
308 gfx::Rect bounds = GetVisibleWebContents()->GetView()->GetViewBounds(); 308 gfx::Rect bounds = GetVisibleWebContents()->GetView()->GetViewBounds();
309 return gfx::Point( 309 return gfx::Point(
310 std::max(0, (bounds.width() - size.width()) / 2), 310 std::max(0, (bounds.width() - size.width()) / 2),
311 std::max(0, (bounds.height() - size.height()) / 2)); 311 std::max(0, (bounds.height() - size.height()) / 2));
312 } 312 }
313 313
314 gfx::Size ExtensionHost::GetMaximumDialogSize() {
315 if (!GetVisibleWebContents())
316 return gfx::Size();
317 return GetVisibleWebContents()->GetView()->GetViewBounds().size();
318 }
319
314 void ExtensionHost::AddObserver( 320 void ExtensionHost::AddObserver(
315 web_modal::WebContentsModalDialogHostObserver* observer) { 321 web_modal::WebContentsModalDialogHostObserver* observer) {
316 } 322 }
317 323
318 void ExtensionHost::RemoveObserver( 324 void ExtensionHost::RemoveObserver(
319 web_modal::WebContentsModalDialogHostObserver* observer) { 325 web_modal::WebContentsModalDialogHostObserver* observer) {
320 } 326 }
321 #endif 327 #endif
322 328
323 void ExtensionHost::Observe(int type, 329 void ExtensionHost::Observe(int type,
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 700
695 void ExtensionHost::RequestMediaAccessPermission( 701 void ExtensionHost::RequestMediaAccessPermission(
696 content::WebContents* web_contents, 702 content::WebContents* web_contents,
697 const content::MediaStreamRequest& request, 703 const content::MediaStreamRequest& request,
698 const content::MediaResponseCallback& callback) { 704 const content::MediaResponseCallback& callback) {
699 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( 705 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
700 web_contents, request, callback, extension()); 706 web_contents, request, callback, extension());
701 } 707 }
702 708
703 } // namespace extensions 709 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/printing/print_preview_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698