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

Side by Side Diff: chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm

Issue 8919017: Split UserMetrics into API vs. implementation. Move API to content/public. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Version for commit (merged again). Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/importer/importer_host.h" 10 #include "chrome/browser/importer/importer_host.h"
11 #include "chrome/browser/importer/importer_lock_dialog.h" 11 #include "chrome/browser/importer/importer_lock_dialog.h"
12 #include "content/browser/user_metrics.h" 12 #include "content/public/browser/user_metrics.h"
13 #include "grit/chromium_strings.h" 13 #include "grit/chromium_strings.h"
14 #include "grit/generated_resources.h" 14 #include "grit/generated_resources.h"
15 #include "ui/base/l10n/l10n_util_mac.h" 15 #include "ui/base/l10n/l10n_util_mac.h"
16 16
17 using content::UserMetricsAction;
18
17 namespace importer { 19 namespace importer {
18 20
19 void ShowImportLockDialog(gfx::NativeWindow parent, 21 void ShowImportLockDialog(gfx::NativeWindow parent,
20 ImporterHost* importer_host) { 22 ImporterHost* importer_host) {
21 scoped_nsobject<NSAlert> lock_alert([[NSAlert alloc] init]); 23 scoped_nsobject<NSAlert> lock_alert([[NSAlert alloc] init]);
22 [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup( 24 [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup(
23 IDS_IMPORTER_LOCK_OK)]; 25 IDS_IMPORTER_LOCK_OK)];
24 [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup( 26 [lock_alert addButtonWithTitle:l10n_util::GetNSStringWithFixup(
25 IDS_IMPORTER_LOCK_CANCEL)]; 27 IDS_IMPORTER_LOCK_CANCEL)];
26 [lock_alert setInformativeText:l10n_util::GetNSStringWithFixup( 28 [lock_alert setInformativeText:l10n_util::GetNSStringWithFixup(
27 IDS_IMPORTER_LOCK_TEXT)]; 29 IDS_IMPORTER_LOCK_TEXT)];
28 [lock_alert setMessageText:l10n_util::GetNSStringWithFixup( 30 [lock_alert setMessageText:l10n_util::GetNSStringWithFixup(
29 IDS_IMPORTER_LOCK_TITLE)]; 31 IDS_IMPORTER_LOCK_TITLE)];
30 32
31 bool is_continue = [lock_alert runModal] == NSAlertFirstButtonReturn; 33 bool is_continue = [lock_alert runModal] == NSAlertFirstButtonReturn;
32 MessageLoop::current()->PostTask(FROM_HERE, 34 MessageLoop::current()->PostTask(FROM_HERE,
33 base::Bind(&ImporterHost::OnImportLockDialogEnd, 35 base::Bind(&ImporterHost::OnImportLockDialogEnd,
34 importer_host, is_continue)); 36 importer_host, is_continue));
35 UserMetrics::RecordAction(UserMetricsAction("ImportLockDialogCocoa_Shown")); 37 content::RecordAction(UserMetricsAction("ImportLockDialogCocoa_Shown"));
36 } 38 }
37 39
38 } // namespace importer 40 } // namespace importer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698