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

Side by Side Diff: chrome/browser/ui/views/extensions/shell_window_views.cc

Issue 10827218: Replace gfx::ScopedSkRegion with scoped_ptr<SkRegion>. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « chrome/browser/ui/views/extensions/shell_window_views.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 path.lineTo(width, height - radius - 1); 519 path.lineTo(width, height - radius - 1);
520 path.lineTo(width - radius - 1, height); 520 path.lineTo(width - radius - 1, height);
521 path.lineTo(radius + 1, height); 521 path.lineTo(radius + 1, height);
522 path.lineTo(0, height - radius - 1); 522 path.lineTo(0, height - radius - 1);
523 path.close(); 523 path.close();
524 } 524 }
525 SetWindowRgn(web_contents()->GetNativeView(), path.CreateNativeRegion(), 1); 525 SetWindowRgn(web_contents()->GetNativeView(), path.CreateNativeRegion(), 1);
526 526
527 SkRegion* rgn = new SkRegion; 527 SkRegion* rgn = new SkRegion;
528 if (!window_->IsFullscreen()) { 528 if (!window_->IsFullscreen()) {
529 if (draggable_region_.Get()) 529 if (draggable_region())
530 rgn->op(*draggable_region_.Get(), SkRegion::kUnion_Op); 530 rgn->op(*draggable_region(), SkRegion::kUnion_Op);
531 if (!window_->IsMaximized()) { 531 if (!window_->IsMaximized()) {
532 if (frameless_) 532 if (frameless_)
533 rgn->op(0, 0, width, kResizeInsideBoundsSize, SkRegion::kUnion_Op); 533 rgn->op(0, 0, width, kResizeInsideBoundsSize, SkRegion::kUnion_Op);
534 rgn->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); 534 rgn->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op);
535 rgn->op(width - kResizeInsideBoundsSize, 0, width, height, 535 rgn->op(width - kResizeInsideBoundsSize, 0, width, height,
536 SkRegion::kUnion_Op); 536 SkRegion::kUnion_Op);
537 rgn->op(0, height - kResizeInsideBoundsSize, width, height, 537 rgn->op(0, height - kResizeInsideBoundsSize, width, height,
538 SkRegion::kUnion_Op); 538 SkRegion::kUnion_Op);
539 } 539 }
540 } 540 }
(...skipping 29 matching lines...) Expand all
570 regions.begin(); 570 regions.begin();
571 iter != regions.end(); ++iter) { 571 iter != regions.end(); ++iter) {
572 const extensions::DraggableRegion& region = *iter; 572 const extensions::DraggableRegion& region = *iter;
573 draggable_region->op(region.bounds.x(), 573 draggable_region->op(region.bounds.x(),
574 region.bounds.y(), 574 region.bounds.y(),
575 region.bounds.right(), 575 region.bounds.right(),
576 region.bounds.bottom(), 576 region.bounds.bottom(),
577 SkRegion::kDifference_Op); 577 SkRegion::kDifference_Op);
578 } 578 }
579 579
580 draggable_region_.Set(draggable_region); 580 draggable_region_.reset(draggable_region);
581 OnViewWasResized(); 581 OnViewWasResized();
582 } 582 }
583 583
584 // static 584 // static
585 ShellWindow* ShellWindow::CreateImpl(Profile* profile, 585 ShellWindow* ShellWindow::CreateImpl(Profile* profile,
586 const extensions::Extension* extension, 586 const extensions::Extension* extension,
587 const GURL& url, 587 const GURL& url,
588 const ShellWindow::CreateParams& params) { 588 const ShellWindow::CreateParams& params) {
589 return new ShellWindowViews(profile, extension, url, params); 589 return new ShellWindowViews(profile, extension, url, params);
590 } 590 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/shell_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698