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

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

Issue 10442017: Rename GetRootWindow() -> GetPrimaryRootWindow() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git-try -b linux_chromeos,win_aura Created 8 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
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 FeedbackUtil::GetScreenshotPng(); 146 FeedbackUtil::GetScreenshotPng();
147 last_screenshot_png->clear(); 147 last_screenshot_png->clear();
148 148
149 gfx::NativeWindow native_window; 149 gfx::NativeWindow native_window;
150 gfx::Rect snapshot_bounds; 150 gfx::Rect snapshot_bounds;
151 151
152 #if defined(OS_CHROMEOS) 152 #if defined(OS_CHROMEOS)
153 // For ChromeOS, don't use the browser window but the root window 153 // For ChromeOS, don't use the browser window but the root window
154 // instead to grab the screenshot. We want everything on the screen, not 154 // instead to grab the screenshot. We want everything on the screen, not
155 // just the current browser. 155 // just the current browser.
156 native_window = ash::Shell::GetRootWindow(); 156 native_window = ash::Shell::GetPrimaryRootWindow();
157 snapshot_bounds = gfx::Rect(native_window->bounds()); 157 snapshot_bounds = gfx::Rect(native_window->bounds());
158 #else 158 #else
159 native_window = browser->window()->GetNativeHandle(); 159 native_window = browser->window()->GetNativeHandle();
160 snapshot_bounds = gfx::Rect(browser->window()->GetBounds().size()); 160 snapshot_bounds = gfx::Rect(browser->window()->GetBounds().size());
161 #endif 161 #endif
162 bool success = browser::GrabWindowSnapshot(native_window, 162 bool success = browser::GrabWindowSnapshot(native_window,
163 last_screenshot_png, 163 last_screenshot_png,
164 snapshot_bounds); 164 snapshot_bounds);
165 FeedbackUtil::SetScreenshotSize(success ? snapshot_bounds : gfx::Rect()); 165 FeedbackUtil::SetScreenshotSize(success ? snapshot_bounds : gfx::Rect());
166 166
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 size_t sort_size = std::min(max_saved, screenshot_filepaths.size()); 614 size_t sort_size = std::min(max_saved, screenshot_filepaths.size());
615 std::partial_sort(screenshot_filepaths.begin(), 615 std::partial_sort(screenshot_filepaths.begin(),
616 screenshot_filepaths.begin() + sort_size, 616 screenshot_filepaths.begin() + sort_size,
617 screenshot_filepaths.end(), 617 screenshot_filepaths.end(),
618 ScreenshotTimestampComp); 618 ScreenshotTimestampComp);
619 for (size_t i = 0; i < sort_size; ++i) 619 for (size_t i = 0; i < sort_size; ++i)
620 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) + 620 saved_screenshots->push_back(std::string(kSavedScreenshotsUrl) +
621 screenshot_filepaths[i]); 621 screenshot_filepaths[i]);
622 } 622 }
623 #endif 623 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_dialog.cc ('k') | chrome/test/base/view_event_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698