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

Side by Side Diff: chrome/browser/ui/views/ash/screenshot_taker.cc

Issue 9802035: Revert "Close the screenshot flash effect before the screenshot task is actually executed." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/views/ash/screenshot_taker.h" 5 #include "chrome/browser/ui/views/ash/screenshot_taker.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 rect, 110 rect,
111 base::Bind(&TakeScreenshot, base::Unretained(window), rect)); 111 base::Bind(&TakeScreenshot, base::Unretained(window), rect));
112 } 112 }
113 113
114 void ScreenshotTaker::HandleTakeScreenshot(aura::Window* window) { 114 void ScreenshotTaker::HandleTakeScreenshot(aura::Window* window) {
115 HandleTakePartialScreenshot(window, window->bounds()); 115 HandleTakePartialScreenshot(window, window->bounds());
116 } 116 }
117 117
118 void ScreenshotTaker::CloseVisualFeedbackLayer(const base::Closure& task) { 118 void ScreenshotTaker::CloseVisualFeedbackLayer(const base::Closure& task) {
119 visual_feedback_layer_.reset(); 119 visual_feedback_layer_.reset();
120 // Hide the visual feedback immediately because |task| may take a long time 120 task.Run();
121 // to finish.
122 MessageLoopForUI::current()->PostTask(FROM_HERE, task);
123 } 121 }
124 122
125 void ScreenshotTaker::DisplayVisualFeedback(const gfx::Rect& rect, 123 void ScreenshotTaker::DisplayVisualFeedback(const gfx::Rect& rect,
126 const base::Closure& task) { 124 const base::Closure& task) {
127 visual_feedback_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); 125 visual_feedback_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
128 visual_feedback_layer_->SetColor(SK_ColorWHITE); 126 visual_feedback_layer_->SetColor(SK_ColorWHITE);
129 visual_feedback_layer_->SetOpacity(kVisualFeedbackLayerOpacity); 127 visual_feedback_layer_->SetOpacity(kVisualFeedbackLayerOpacity);
130 visual_feedback_layer_->SetBounds(rect); 128 visual_feedback_layer_->SetBounds(rect);
131 129
132 ui::Layer* parent = ash::Shell::GetInstance()->GetContainer( 130 ui::Layer* parent = ash::Shell::GetInstance()->GetContainer(
133 ash::internal::kShellWindowId_OverlayContainer)->layer(); 131 ash::internal::kShellWindowId_OverlayContainer)->layer();
134 parent->Add(visual_feedback_layer_.get()); 132 parent->Add(visual_feedback_layer_.get());
135 visual_feedback_layer_->SetVisible(true); 133 visual_feedback_layer_->SetVisible(true);
136 134
137 MessageLoopForUI::current()->PostDelayedTask( 135 MessageLoopForUI::current()->PostDelayedTask(
138 FROM_HERE, 136 FROM_HERE,
139 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer, 137 base::Bind(&ScreenshotTaker::CloseVisualFeedbackLayer,
140 base::Unretained(this), 138 base::Unretained(this),
141 task), 139 task),
142 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs)); 140 base::TimeDelta::FromMilliseconds(kVisualFeedbackLayerDisplayTimeMs));
143 } 141 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698