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

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

Issue 10827193: Brushes up the code of screenshot filename. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEWTAB_T); 434 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEWTAB_T);
435 return HandleNewTab(); 435 return HandleNewTab();
436 case NEW_WINDOW: 436 case NEW_WINDOW:
437 return HandleNewWindow(false /* is_incognito */); 437 return HandleNewWindow(false /* is_incognito */);
438 case RESTORE_TAB: 438 case RESTORE_TAB:
439 return HandleRestoreTab(); 439 return HandleRestoreTab();
440 case TAKE_SCREENSHOT: 440 case TAKE_SCREENSHOT:
441 case TAKE_SCREENSHOT_BY_PRTSCN_KEY: 441 case TAKE_SCREENSHOT_BY_PRTSCN_KEY:
442 if (screenshot_delegate_.get() && 442 if (screenshot_delegate_.get() &&
443 screenshot_delegate_->CanTakeScreenshot()) { 443 screenshot_delegate_->CanTakeScreenshot()) {
444 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 444 screenshot_delegate_->HandleTakeScreenshotForAllRootWindows();
445 for (size_t i = 0; i < root_windows.size(); ++i)
446 screenshot_delegate_->HandleTakeScreenshot(root_windows[i]);
447 } 445 }
448 // Return true to prevent propagation of the key event. 446 // Return true to prevent propagation of the key event.
449 return true; 447 return true;
450 case TAKE_PARTIAL_SCREENSHOT: 448 case TAKE_PARTIAL_SCREENSHOT:
451 if (screenshot_delegate_.get()) { 449 if (screenshot_delegate_.get()) {
452 ash::PartialScreenshotView::StartPartialScreenshot( 450 ash::PartialScreenshotView::StartPartialScreenshot(
453 screenshot_delegate_.get()); 451 screenshot_delegate_.get());
454 } 452 }
455 // Return true to prevent propagation of the key event because 453 // Return true to prevent propagation of the key event because
456 // this key combination is reserved for partial screenshot. 454 // this key combination is reserved for partial screenshot.
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 accelerators_.insert( 744 accelerators_.insert(
747 std::make_pair(accelerator, accelerators[i].action)); 745 std::make_pair(accelerator, accelerators[i].action));
748 } 746 }
749 } 747 }
750 748
751 bool AcceleratorController::CanHandleAccelerators() const { 749 bool AcceleratorController::CanHandleAccelerators() const {
752 return true; 750 return true;
753 } 751 }
754 752
755 } // namespace ash 753 } // 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