forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented GetWindowSnapshot on RenderViewImpl
This necessitated the relocation of the previous chrome::GrabWindowSnapshot code to ui/snapshot, which has been turned into it's own component to avoid circular dependencies with aura. A new variant of GrabWindowSnapshot, GrabViewSnapshot, has been added as well to facilitate easier usage by views. chrome::GrabWindowSnapshotForUser was left in place to accomodate existing calls to the API, but now calls up to the ui/snapshot code. This is a subset of the prior CL 11362023, which has been broken apart to facilitate easier reviews BUG=157479 Review URL: https://chromiumcodereview.appspot.com/11399002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173329 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
bajones@chromium.org
committed
Dec 15, 2012
1 parent
d72acb0
commit c9bc8f1
Showing
23 changed files
with
330 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
include_rules = [ | ||
"+skia", | ||
"+ui/aura", | ||
"+ui/base", | ||
"+ui/compositor", | ||
"+ui/gfx", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
{ | ||
'variables': { | ||
'chromium_code': 1, | ||
}, | ||
'targets': [ | ||
{ | ||
'target_name': 'snapshot', | ||
'type': '<(component)', | ||
'dependencies': [ | ||
'../../skia/skia.gyp:skia', | ||
'../../base/base.gyp:base', | ||
'../ui.gyp:ui', | ||
], | ||
'defines': [ | ||
'SNAPSHOT_IMPLEMENTATION', | ||
], | ||
'sources': [ | ||
'snapshot.h', | ||
'snapshot_android.cc', | ||
'snapshot_aura.cc', | ||
'snapshot_export.h', | ||
'snapshot_gtk.cc', | ||
'snapshot_ios.mm', | ||
'snapshot_mac.mm', | ||
'snapshot_win.cc', | ||
], | ||
'include_dirs': [ | ||
'..', | ||
], | ||
'conditions': [ | ||
['use_aura==1', { | ||
'dependencies': [ | ||
'../aura/aura.gyp:aura', | ||
'../compositor/compositor.gyp:compositor', | ||
], | ||
}], | ||
['use_aura==1 and OS=="win"', { | ||
'sources/': [ | ||
['exclude', 'snapshot_win.cc'], | ||
], | ||
}], | ||
], | ||
}, | ||
{ | ||
'target_name': 'snapshot_unittests', | ||
'type': '<(gtest_target_type)', | ||
'dependencies': [ | ||
'../../skia/skia.gyp:skia', | ||
'../../base/base.gyp:base', | ||
'../../testing/gtest.gyp:gtest', | ||
'../../testing/gmock.gyp:gmock', | ||
'../../testing/gtest.gyp:gtest', | ||
'../ui.gyp:ui', | ||
'snapshot' | ||
], | ||
'sources': [ | ||
'snapshot_mac_unittest.mm', | ||
] | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef UI_SNAPSHOT_SNAPSHOT_H_ | ||
#define UI_SNAPSHOT_SNAPSHOT_H_ | ||
|
||
#include <vector> | ||
|
||
#include "ui/gfx/native_widget_types.h" | ||
#include "ui/snapshot/snapshot_export.h" | ||
|
||
namespace gfx { | ||
class Rect; | ||
} | ||
|
||
namespace ui { | ||
|
||
// Grabs a snapshot of the window/view. No security checks are done. | ||
// This is intended to be used for debugging purposes where no BrowserProcess | ||
// instance is available (ie. tests). DO NOT use in a result of user action. | ||
SNAPSHOT_EXPORT bool GrabWindowSnapshot( | ||
gfx::NativeWindow window, | ||
std::vector<unsigned char>* png_representation, | ||
const gfx::Rect& snapshot_bounds); | ||
|
||
SNAPSHOT_EXPORT bool GrabViewSnapshot( | ||
gfx::NativeView view, | ||
std::vector<unsigned char>* png_representation, | ||
const gfx::Rect& snapshot_bounds); | ||
|
||
} // namespace ui | ||
|
||
#endif // UI_SNAPSHOT_SNAPSHOT_H_ |
Oops, something went wrong.