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

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 10802046: Ignores screenshot taking invocations if it's too close to the previous one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 | ash/accelerators/accelerator_controller_unittest.cc » ('j') | 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 "ash/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 case NEW_TAB: 436 case NEW_TAB:
437 if (key_code == ui::VKEY_T && shell->delegate()) 437 if (key_code == ui::VKEY_T && shell->delegate())
438 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEWTAB_T); 438 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEWTAB_T);
439 return HandleNewTab(); 439 return HandleNewTab();
440 case NEW_WINDOW: 440 case NEW_WINDOW:
441 return HandleNewWindow(false /* is_incognito */); 441 return HandleNewWindow(false /* is_incognito */);
442 case RESTORE_TAB: 442 case RESTORE_TAB:
443 return HandleRestoreTab(); 443 return HandleRestoreTab();
444 case TAKE_SCREENSHOT: 444 case TAKE_SCREENSHOT:
445 case TAKE_SCREENSHOT_BY_PRTSCN_KEY: 445 case TAKE_SCREENSHOT_BY_PRTSCN_KEY:
446 if (screenshot_delegate_.get()) { 446 if (screenshot_delegate_.get() &&
447 screenshot_delegate_->CanTakeScreenshot()) {
447 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 448 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
448 for (size_t i = 0; i < root_windows.size(); ++i) 449 for (size_t i = 0; i < root_windows.size(); ++i)
449 screenshot_delegate_->HandleTakeScreenshot(root_windows[i]); 450 screenshot_delegate_->HandleTakeScreenshot(root_windows[i]);
450 } 451 }
451 // Return true to prevent propagation of the key event. 452 // Return true to prevent propagation of the key event.
452 return true; 453 return true;
453 case TAKE_PARTIAL_SCREENSHOT: 454 case TAKE_PARTIAL_SCREENSHOT:
454 if (screenshot_delegate_.get()) 455 if (screenshot_delegate_.get())
455 ash::Shell::GetInstance()->delegate()-> 456 ash::Shell::GetInstance()->delegate()->
456 StartPartialScreenshot(screenshot_delegate_.get()); 457 StartPartialScreenshot(screenshot_delegate_.get());
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 // Then set this one as active. 737 // Then set this one as active.
737 Shell::GetInstance()->launcher()->ActivateLauncherItem(found_index); 738 Shell::GetInstance()->launcher()->ActivateLauncherItem(found_index);
738 } 739 }
739 } 740 }
740 741
741 bool AcceleratorController::CanHandleAccelerators() const { 742 bool AcceleratorController::CanHandleAccelerators() const {
742 return true; 743 return true;
743 } 744 }
744 745
745 } // namespace ash 746 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698