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

Side by Side Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 14576003: PlatformAppBrowserTest.ShellWindowRestorePosition: Test create after window close (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make frame component of GetRestoredBounds platform dependent Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc » ('j') | 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/extensions/shell_window.h" 5 #include "chrome/browser/ui/extensions/shell_window.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/app_window_contents.h" 9 #include "chrome/browser/extensions/app_window_contents.h"
10 #include "chrome/browser/extensions/extension_process_manager.h" 10 #include "chrome/browser/extensions/extension_process_manager.h"
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 if (window_key_.empty()) 568 if (window_key_.empty())
569 return; 569 return;
570 if (!native_app_window_) 570 if (!native_app_window_)
571 return; 571 return;
572 572
573 extensions::ShellWindowGeometryCache* cache = 573 extensions::ShellWindowGeometryCache* cache =
574 extensions::ExtensionSystem::Get(profile())-> 574 extensions::ExtensionSystem::Get(profile())->
575 shell_window_geometry_cache(); 575 shell_window_geometry_cache();
576 576
577 gfx::Rect bounds = native_app_window_->GetRestoredBounds(); 577 gfx::Rect bounds = native_app_window_->GetRestoredBounds();
578 bounds.Inset(native_app_window_->GetFrameInsets());
579 cache->SaveGeometry(extension()->id(), window_key_, bounds); 578 cache->SaveGeometry(extension()->id(), window_key_, bounds);
580 } 579 }
581 580
582 // static 581 // static
583 SkRegion* ShellWindow::RawDraggableRegionsToSkRegion( 582 SkRegion* ShellWindow::RawDraggableRegionsToSkRegion(
584 const std::vector<extensions::DraggableRegion>& regions) { 583 const std::vector<extensions::DraggableRegion>& regions) {
585 SkRegion* sk_region = new SkRegion; 584 SkRegion* sk_region = new SkRegion;
586 for (std::vector<extensions::DraggableRegion>::const_iterator iter = 585 for (std::vector<extensions::DraggableRegion>::const_iterator iter =
587 regions.begin(); 586 regions.begin();
588 iter != regions.end(); ++iter) { 587 iter != regions.end(); ++iter) {
589 const extensions::DraggableRegion& region = *iter; 588 const extensions::DraggableRegion& region = *iter;
590 sk_region->op( 589 sk_region->op(
591 region.bounds.x(), 590 region.bounds.x(),
592 region.bounds.y(), 591 region.bounds.y(),
593 region.bounds.right(), 592 region.bounds.right(),
594 region.bounds.bottom(), 593 region.bounds.bottom(),
595 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 594 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
596 } 595 }
597 return sk_region; 596 return sk_region;
598 } 597 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698