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

Side by Side Diff: chrome/browser/ui/ash/palette_delegate_chromeos.cc

Issue 2235063002: Add create note palette action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app-runtime-changes
Patch Set: Initial upload Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ash/palette_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/palette_delegate_chromeos.h"
6 6
7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h"
8 #include "ash/screenshot_delegate.h" 8 #include "ash/screenshot_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/utility/screenshot_controller.h" 10 #include "ash/utility/screenshot_controller.h"
11 #include "chrome/browser/chromeos/note_taking_app_utils.h"
12 #include "chrome/browser/profiles/profile_manager.h"
11 13
12 namespace chromeos { 14 namespace chromeos {
15 namespace {
16
17 Profile* GetProfile() {
18 return ProfileManager::GetActiveUserProfile();
19 }
20
21 } // namespace
13 22
14 PaletteDelegateChromeOS::PaletteDelegateChromeOS() {} 23 PaletteDelegateChromeOS::PaletteDelegateChromeOS() {}
15 24
16 PaletteDelegateChromeOS::~PaletteDelegateChromeOS() {} 25 PaletteDelegateChromeOS::~PaletteDelegateChromeOS() {}
17 26
27 void PaletteDelegateChromeOS::CreateNote() {
28 chromeos::LaunchNoteTakingAppForNewNote(GetProfile(), base::FilePath());
29 }
30
31 bool PaletteDelegateChromeOS::HasNoteApp() {
32 return chromeos::IsNoteTakingAppAvailable(GetProfile());
33 }
34
18 void PaletteDelegateChromeOS::TakeScreenshot() { 35 void PaletteDelegateChromeOS::TakeScreenshot() {
19 auto screenshot_controller = 36 auto screenshot_controller =
20 ash::Shell::GetInstance()->screenshot_controller(); 37 ash::Shell::GetInstance()->screenshot_controller();
21 auto screenshot_delegate = ash::Shell::GetInstance() 38 auto screenshot_delegate = ash::Shell::GetInstance()
22 ->accelerator_controller_delegate() 39 ->accelerator_controller_delegate()
23 ->screenshot_delegate(); 40 ->screenshot_delegate();
24 41
25 screenshot_controller->StartWindowScreenshotSession(screenshot_delegate); 42 screenshot_controller->StartWindowScreenshotSession(screenshot_delegate);
26 } 43 }
27 44
28 void PaletteDelegateChromeOS::TakePartialScreenshot() { 45 void PaletteDelegateChromeOS::TakePartialScreenshot() {
29 auto screenshot_controller = 46 auto screenshot_controller =
30 ash::Shell::GetInstance()->screenshot_controller(); 47 ash::Shell::GetInstance()->screenshot_controller();
31 auto screenshot_delegate = ash::Shell::GetInstance() 48 auto screenshot_delegate = ash::Shell::GetInstance()
32 ->accelerator_controller_delegate() 49 ->accelerator_controller_delegate()
33 ->screenshot_delegate(); 50 ->screenshot_delegate();
34 51
35 screenshot_controller->set_pointer_only(true); 52 screenshot_controller->set_pointer_only(true);
36 screenshot_controller->StartPartialScreenshotSession(screenshot_delegate, 53 screenshot_controller->StartPartialScreenshotSession(screenshot_delegate,
37 false); 54 false);
38 } 55 }
39 56
40 } // namespace chromeos 57 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698