summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authortapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-04 09:48:53 +0000
committertapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-04 09:48:53 +0000
commitc17ca9d20bd6d8ba21e7b13fa0e2634c9951f268 (patch)
treef6f3cf541a3a3304198f833fa8c452452150de11 /base
parent1b6d130700ac7b9250c034ef497675b2c6d4fee2 (diff)
downloadchromium_src-c17ca9d20bd6d8ba21e7b13fa0e2634c9951f268.zip
chromium_src-c17ca9d20bd6d8ba21e7b13fa0e2634c9951f268.tar.gz
chromium_src-c17ca9d20bd6d8ba21e7b13fa0e2634c9951f268.tar.bz2
UMA for Windows 8 Secondary Tile pinning/unpinning user actions
triggered from hotdog -> Bookmarks when in Metro mode. To perform the metrics recording, this CL includes changes to provide a callback mechanism for the asynchronous tile creation in metro_driver.dll to report back the result of the use gesture to the browser process. Note that both metro_driver.dll and chrome.dll link statically to base, so they have distinct data segments holding UMA histograms, hence the callback. BUG=160840 TEST=In Windows 8 Metro Mode, Hotdog -> Bookmarks -> Pin to start page: - pin and cancel (escape/click/touch off popup) - pin and confirm - (when pinned) unpin and cancel - unpin and confirm Above should all work (and report UMA histogram data). Review URL: https://chromiumcodereview.appspot.com/11280112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170916 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/win/metro.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/base/win/metro.h b/base/win/metro.h
index a43bbc3..9354de8 100644
--- a/base/win/metro.h
+++ b/base/win/metro.h
@@ -9,6 +9,8 @@
#include <wpcapi.h>
#include "base/base_export.h"
+#include "base/callback.h"
+#include "base/file_path.h"
#include "base/string16.h"
namespace base {
@@ -36,6 +38,26 @@ enum MetroPreviousExecutionState {
LASTEXECUTIONSTATE,
};
+// Enum values for UMA histogram reporting of site-specific tile pinning.
+// TODO(tapted): Move this to win8/util when ready (http://crbug.com/160288).
+enum MetroSecondaryTilePinUmaResult {
+ METRO_PIN_STATE_NONE,
+ METRO_PIN_INITIATED,
+ METRO_PIN_LOGO_READY,
+ METRO_PIN_REQUEST_SHOW_ERROR,
+ METRO_PIN_RESULT_CANCEL,
+ METRO_PIN_RESULT_OK,
+ METRO_PIN_RESULT_OTHER,
+ METRO_PIN_RESULT_ERROR,
+ METRO_UNPIN_INITIATED,
+ METRO_UNPIN_REQUEST_SHOW_ERROR,
+ METRO_UNPIN_RESULT_CANCEL,
+ METRO_UNPIN_RESULT_OK,
+ METRO_UNPIN_RESULT_OTHER,
+ METRO_UNPIN_RESULT_ERROR,
+ METRO_PIN_STATE_LIMIT
+};
+
// Contains information about the currently displayed tab in metro mode.
struct CurrentTabInfo {
wchar_t* title;
@@ -97,6 +119,23 @@ typedef void (*MetroNotification)(const char* origin_url,
MetroNotificationClickedHandler handler,
const wchar_t* handler_context);
+// Callback for UMA invoked by Metro Pin and UnPin functions after user gesture.
+typedef base::Callback<void(MetroSecondaryTilePinUmaResult)>
+ MetroPinUmaResultCallback;
+
+// Function to pin a site-specific tile (bookmark) to the start screen.
+typedef void (*MetroPinToStartScreen)(
+ const string16& tile_id,
+ const string16& title,
+ const string16& url,
+ const FilePath& logo_path,
+ const MetroPinUmaResultCallback& callback);
+
+// Function to un-pin a site-specific tile (bookmark) from the start screen.
+typedef void (*MetroUnPinFromStartScreen)(
+ const string16& title_id,
+ const MetroPinUmaResultCallback& callback);
+
} // namespace win
} // namespace base