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

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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (key_code == ui::VKEY_T && shell->delegate()) 433 if (key_code == ui::VKEY_T && shell->delegate())
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())
Daniel Erat 2012/08/08 16:33:08 nit: add curly braces since if condition is two li
Jun Mukai 2012/08/09 04:40:36 Done.
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 }
448 // Return true to prevent propagation of the key event. 445 // Return true to prevent propagation of the key event.
449 return true; 446 return true;
450 case TAKE_PARTIAL_SCREENSHOT: 447 case TAKE_PARTIAL_SCREENSHOT:
451 if (screenshot_delegate_.get()) { 448 if (screenshot_delegate_.get()) {
452 ash::PartialScreenshotView::StartPartialScreenshot( 449 ash::PartialScreenshotView::StartPartialScreenshot(
453 screenshot_delegate_.get()); 450 screenshot_delegate_.get());
454 } 451 }
455 // Return true to prevent propagation of the key event because 452 // Return true to prevent propagation of the key event because
456 // this key combination is reserved for partial screenshot. 453 // this key combination is reserved for partial screenshot.
457 return true; 454 return true;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 accelerators_.insert( 743 accelerators_.insert(
747 std::make_pair(accelerator, accelerators[i].action)); 744 std::make_pair(accelerator, accelerators[i].action));
748 } 745 }
749 } 746 }
750 747
751 bool AcceleratorController::CanHandleAccelerators() const { 748 bool AcceleratorController::CanHandleAccelerators() const {
752 return true; 749 return true;
753 } 750 }
754 751
755 } // namespace ash 752 } // 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