OLD | NEW |
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/ui/views/extensions/shell_window_views.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/common/extensions/draggable_region.h" | 9 #include "chrome/common/extensions/draggable_region.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 return window_; | 485 return window_; |
486 } | 486 } |
487 | 487 |
488 const views::Widget* ShellWindowViews::GetWidget() const { | 488 const views::Widget* ShellWindowViews::GetWidget() const { |
489 return window_; | 489 return window_; |
490 } | 490 } |
491 | 491 |
492 void ShellWindowViews::OnViewWasResized() { | 492 void ShellWindowViews::OnViewWasResized() { |
493 // TODO(jeremya): this doesn't seem like a terribly elegant way to keep the | 493 // TODO(jeremya): this doesn't seem like a terribly elegant way to keep the |
494 // window shape in sync. | 494 // window shape in sync. |
495 #if defined(OS_WIN) && !defined(USE_AURA) | |
496 // Set the window shape of the RWHV. | |
497 DCHECK(window_); | 495 DCHECK(window_); |
498 DCHECK(web_view_); | 496 DCHECK(web_view_); |
| 497 #if defined(USE_ASH) |
| 498 if (draggable_region()) { |
| 499 SkRegion* rgn = new SkRegion; |
| 500 rgn->op(*draggable_region(), SkRegion::kUnion_Op); |
| 501 GetNativeWindow()->SetDraggableRegion(rgn); |
| 502 } |
| 503 #elif defined(OS_WIN) |
| 504 // Set the window shape of the RWHV. |
499 gfx::Size sz = web_view_->size(); | 505 gfx::Size sz = web_view_->size(); |
500 int height = sz.height(), width = sz.width(); | 506 int height = sz.height(), width = sz.width(); |
501 int radius = 1; | 507 int radius = 1; |
502 gfx::Path path; | 508 gfx::Path path; |
503 if (window_->IsMaximized() || window_->IsFullscreen()) { | 509 if (window_->IsMaximized() || window_->IsFullscreen()) { |
504 // Don't round the corners when the window is maximized or fullscreen. | 510 // Don't round the corners when the window is maximized or fullscreen. |
505 path.addRect(0, 0, width, height); | 511 path.addRect(0, 0, width, height); |
506 } else { | 512 } else { |
507 if (frameless_) { | 513 if (frameless_) { |
508 path.moveTo(0, radius); | 514 path.moveTo(0, radius); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 OnViewWasResized(); | 585 OnViewWasResized(); |
580 } | 586 } |
581 | 587 |
582 // static | 588 // static |
583 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 589 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
584 const extensions::Extension* extension, | 590 const extensions::Extension* extension, |
585 const GURL& url, | 591 const GURL& url, |
586 const ShellWindow::CreateParams& params) { | 592 const ShellWindow::CreateParams& params) { |
587 return new ShellWindowViews(profile, extension, url, params); | 593 return new ShellWindowViews(profile, extension, url, params); |
588 } | 594 } |
OLD | NEW |