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

Side by Side Diff: content/browser/frame_host/navigation_entry_screenshot_manager.cc

Issue 136453009: Fix for Issue 331895: Make gesturenav screenshot greyscale (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | ui/gfx/codec/png_codec.h » ('j') | ui/gfx/codec/png_codec.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/frame_host/navigation_entry_screenshot_manager.h" 5 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/worker_pool.h" 8 #include "base/threading/worker_pool.h"
9 #include "content/browser/frame_host/navigation_controller_impl.h" 9 #include "content/browser/frame_host/navigation_controller_impl.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 scoped_refptr<base::RefCountedBytes> data() const { return data_; } 43 scoped_refptr<base::RefCountedBytes> data() const { return data_; }
44 44
45 private: 45 private:
46 friend class base::RefCountedThreadSafe<ScreenshotData>; 46 friend class base::RefCountedThreadSafe<ScreenshotData>;
47 virtual ~ScreenshotData() { 47 virtual ~ScreenshotData() {
48 } 48 }
49 49
50 void EncodeOnWorker(const SkBitmap& bitmap) { 50 void EncodeOnWorker(const SkBitmap& bitmap) {
51 std::vector<unsigned char> data; 51 std::vector<unsigned char> data;
52 if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &data)) 52 if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, true, &data, true))
53 data_ = new base::RefCountedBytes(data); 53 data_ = new base::RefCountedBytes(data);
54 } 54 }
55 55
56 scoped_refptr<base::RefCountedBytes> data_; 56 scoped_refptr<base::RefCountedBytes> data_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(ScreenshotData); 58 DISALLOW_COPY_AND_ASSIGN(ScreenshotData);
59 }; 59 };
60 60
61 NavigationEntryScreenshotManager::NavigationEntryScreenshotManager( 61 NavigationEntryScreenshotManager::NavigationEntryScreenshotManager(
62 NavigationControllerImpl* owner) 62 NavigationControllerImpl* owner)
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 owner_->GetEntryAtIndex(forward)); 267 owner_->GetEntryAtIndex(forward));
268 if (ClearScreenshot(entry)) 268 if (ClearScreenshot(entry))
269 --screenshot_count; 269 --screenshot_count;
270 ++forward; 270 ++forward;
271 } 271 }
272 CHECK_GE(screenshot_count, 0); 272 CHECK_GE(screenshot_count, 0);
273 CHECK_LE(screenshot_count, kMaxScreenshots); 273 CHECK_LE(screenshot_count, kMaxScreenshots);
274 } 274 }
275 275
276 } // namespace content 276 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/codec/png_codec.h » ('j') | ui/gfx/codec/png_codec.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698