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

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

Issue 2376553002: chromeos: Add Screenshot_Annotate metric. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chrome_screenshot_grabber.h" 5 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/common/strings/grit/ash_strings.h" 9 #include "ash/common/strings/grit/ash_strings.h"
10 #include "ash/common/system/system_notifier.h" 10 #include "ash/common/system/system_notifier.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 file_system->GetFile(drive::util::ExtractDrivePath(screenshot_path_), 129 file_system->GetFile(drive::util::ExtractDrivePath(screenshot_path_),
130 base::Bind(&ReadFileAndCopyToClipboardDrive)); 130 base::Bind(&ReadFileAndCopyToClipboardDrive));
131 return; 131 return;
132 } 132 }
133 content::BrowserThread::GetBlockingPool()->PostTask( 133 content::BrowserThread::GetBlockingPool()->PostTask(
134 FROM_HERE, 134 FROM_HERE,
135 base::Bind(&ReadFileAndCopyToClipboardLocal, screenshot_path_)); 135 base::Bind(&ReadFileAndCopyToClipboardLocal, screenshot_path_));
136 break; 136 break;
137 } 137 }
138 case BUTTON_ANNOTATE: { 138 case BUTTON_ANNOTATE: {
139 if (chromeos::IsNoteTakingAppAvailable(profile_)) 139 if (chromeos::IsNoteTakingAppAvailable(profile_)) {
140 chromeos::LaunchNoteTakingAppForNewNote(profile_, screenshot_path_); 140 chromeos::LaunchNoteTakingAppForNewNote(profile_, screenshot_path_);
141 content::RecordAction(base::UserMetricsAction("Screenshot_Annotate"));
142 }
141 break; 143 break;
142 } 144 }
143 default: 145 default:
144 NOTREACHED() << "Unhandled button index " << button_index; 146 NOTREACHED() << "Unhandled button index " << button_index;
145 } 147 }
146 } 148 }
147 bool HasClickedListener() override { return success_; } 149 bool HasClickedListener() override { return success_; }
148 std::string id() const override { return std::string(kNotificationId); } 150 std::string id() const override { return std::string(kNotificationId); }
149 151
150 private: 152 private:
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 464 }
463 465
464 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) { 466 void ChromeScreenshotGrabber::SetProfileForTest(Profile* profile) {
465 profile_for_test_ = profile; 467 profile_for_test_ = profile;
466 } 468 }
467 469
468 Profile* ChromeScreenshotGrabber::GetProfile() { 470 Profile* ChromeScreenshotGrabber::GetProfile() {
469 return profile_for_test_ ? profile_for_test_ 471 return profile_for_test_ ? profile_for_test_
470 : ProfileManager::GetActiveUserProfile(); 472 : ProfileManager::GetActiveUserProfile();
471 } 473 }
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698