diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 05:45:26 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 05:45:26 +0000 |
commit | 862066288bfa2871c36e3ab794fb7f6819a5cdfd (patch) | |
tree | 7edbca6eb7696507b772cf8c73ac7b549eec36d4 /base | |
parent | 639e99c45b2e5b476c58847153133a91f2aec164 (diff) | |
download | chromium_src-862066288bfa2871c36e3ab794fb7f6819a5cdfd.zip chromium_src-862066288bfa2871c36e3ab794fb7f6819a5cdfd.tar.gz chromium_src-862066288bfa2871c36e3ab794fb7f6819a5cdfd.tar.bz2 |
Commiting http://codereview.chromium.org/2017007/show on behalf of rkc@chromium.org.
This change hooks issue report dialog with Google Feedback backend for ChromeOS.
The dialog is going to be used only for Chrome OS at the moment, the previous mechanism is kept intact for other operating systems.
Image and System Info reporting is disabled at the moment; for image, we need
feedback to get their changes in production, for reporting, the system scripts
need to be added (basic Chrome and OS version info is being sent with the report)
BUG=chromium-os:2761
TEST=none, work in progress
TBR=zelidrag
Review URL: http://codereview.chromium.org/2068004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/mac_util.h | 3 | ||||
-rw-r--r-- | base/mac_util.mm | 5 | ||||
-rw-r--r-- | base/mac_util_unittest.mm | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/base/mac_util.h b/base/mac_util.h index 2c59a87..bfe2079 100644 --- a/base/mac_util.h +++ b/base/mac_util.h @@ -118,7 +118,8 @@ void ActivateProcess(pid_t); // Pulls a snapshot of the entire browser into png_representation. void GrabWindowSnapshot(NSWindow* window, - std::vector<unsigned char>* png_representation); + std::vector<unsigned char>* png_representation, + int* width, int* height); // Takes a path to an (executable) binary and tries to provide the path to an // application bundle containing it. It takes the outermost bundle that it can diff --git a/base/mac_util.mm b/base/mac_util.mm index 00ef9e09..cd7a949 100644 --- a/base/mac_util.mm +++ b/base/mac_util.mm @@ -244,7 +244,8 @@ bool ShouldWindowsMiniaturizeOnDoubleClick() { } void GrabWindowSnapshot(NSWindow* window, - std::vector<unsigned char>* png_representation) { + std::vector<unsigned char>* png_representation, + int* width, int* height) { // Make sure to grab the "window frame" view so we get current tab + // tabstrip. NSView* view = [[window contentView] superview]; @@ -255,6 +256,8 @@ void GrabWindowSnapshot(NSWindow* window, const unsigned char* buf = static_cast<const unsigned char*>([data bytes]); NSUInteger length = [data length]; if (buf != NULL && length > 0){ + *width = static_cast<int>([rep pixelsWide]); + *height = static_cast<int>([rep pixelsHigh]); png_representation->assign(buf, buf + length); DCHECK(png_representation->size() > 0); } diff --git a/base/mac_util_unittest.mm b/base/mac_util_unittest.mm index b77472b..aebb731 100644 --- a/base/mac_util_unittest.mm +++ b/base/mac_util_unittest.mm @@ -66,7 +66,9 @@ TEST_F(MacUtilTest, TestGrabWindowSnapshot) { scoped_ptr<std::vector<unsigned char> > png_representation( new std::vector<unsigned char>); - GrabWindowSnapshot(window, png_representation.get()); + int width, height; + GrabWindowSnapshot(window, png_representation.get(), + &width, &height); // Copy png back into NSData object so we can make sure we grabbed a png. scoped_nsobject<NSData> image_data( |