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

Side by Side Diff: chrome/browser/ui/webui/feedback_ui.cc

Issue 10830158: Refactor GrabWindowSnapshot and GrabWindowSnapshotImpl names to GrabWindowSnapshotForUser and GrabW… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed compiling tests, fixed indent 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
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/webui/feedback_ui.h" 5 #include "chrome/browser/ui/webui/feedback_ui.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 #if defined(OS_CHROMEOS) 181 #if defined(OS_CHROMEOS)
182 // For ChromeOS, don't use the browser window but the root window 182 // For ChromeOS, don't use the browser window but the root window
183 // instead to grab the screenshot. We want everything on the screen, not 183 // instead to grab the screenshot. We want everything on the screen, not
184 // just the current browser. 184 // just the current browser.
185 native_window = ash::Shell::GetPrimaryRootWindow(); 185 native_window = ash::Shell::GetPrimaryRootWindow();
186 snapshot_bounds = gfx::Rect(native_window->bounds()); 186 snapshot_bounds = gfx::Rect(native_window->bounds());
187 #else 187 #else
188 native_window = browser->window()->GetNativeWindow(); 188 native_window = browser->window()->GetNativeWindow();
189 snapshot_bounds = gfx::Rect(browser->window()->GetBounds().size()); 189 snapshot_bounds = gfx::Rect(browser->window()->GetBounds().size());
190 #endif 190 #endif
191 bool success = chrome::GrabWindowSnapshot(native_window, last_screenshot_png, 191 bool success = chrome::GrabWindowSnapshotForUser(native_window,
192 snapshot_bounds); 192 last_screenshot_png,
193 snapshot_bounds);
193 FeedbackUtil::SetScreenshotSize(success ? snapshot_bounds : gfx::Rect()); 194 FeedbackUtil::SetScreenshotSize(success ? snapshot_bounds : gfx::Rect());
194 195
195 std::string feedback_url = std::string(chrome::kChromeUIFeedbackURL) + "?" + 196 std::string feedback_url = std::string(chrome::kChromeUIFeedbackURL) + "?" +
196 kSessionIDParameter + base::IntToString(browser->session_id().id()) + 197 kSessionIDParameter + base::IntToString(browser->session_id().id()) +
197 "&" + kTabIndexParameter + base::IntToString(browser->active_index()) + 198 "&" + kTabIndexParameter + base::IntToString(browser->active_index()) +
198 "&" + kDescriptionParameter + 199 "&" + kDescriptionParameter +
199 net::EscapeUrlEncodedData(description_template, false) + "&" + 200 net::EscapeUrlEncodedData(description_template, false) + "&" +
200 kCategoryTagParameter + net::EscapeUrlEncodedData(category_tag, false); 201 kCategoryTagParameter + net::EscapeUrlEncodedData(category_tag, false);
201 202
202 #if defined(OS_CHROMEOS) 203 #if defined(OS_CHROMEOS)
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 size_t sort_size = std::min(max_saved, screenshot_filepaths.size()); 674 size_t sort_size = std::min(max_saved, screenshot_filepaths.size());
674 std::partial_sort(screenshot_filepaths.begin(), 675 std::partial_sort(screenshot_filepaths.begin(),
675 screenshot_filepaths.begin() + sort_size, 676 screenshot_filepaths.begin() + sort_size,
676 screenshot_filepaths.end(), 677 screenshot_filepaths.end(),
677 ScreenshotTimestampComp); 678 ScreenshotTimestampComp);
678 for (size_t i = 0; i < sort_size; ++i) 679 for (size_t i = 0; i < sort_size; ++i)
679 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) + 680 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) +
680 screenshot_filepaths[i]); 681 screenshot_filepaths[i]);
681 } 682 }
682 #endif 683 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/screenshot_taker.cc ('k') | chrome/browser/ui/window_snapshot/window_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698