diff options
184 files changed, 679 insertions, 617 deletions
diff --git a/ash/accelerators/accelerator_commands.cc b/ash/accelerators/accelerator_commands.cc index b50959f..2e403bf 100644 --- a/ash/accelerators/accelerator_commands.cc +++ b/ash/accelerators/accelerator_commands.cc @@ -9,7 +9,7 @@ #include "ash/wm/window_cycle_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" -#include "content/public/browser/user_metrics.h" +#include "base/metrics/user_metrics.h" namespace ash { namespace accelerators { @@ -34,8 +34,7 @@ void ToggleMaximized() { wm::WindowState* window_state = wm::GetActiveWindowState(); if (!window_state) return; - content::RecordAction( - content::UserMetricsAction("Accel_Toggle_Maximized")); + base::RecordAction(base::UserMetricsAction("Accel_Toggle_Maximized")); // Get out of fullscreen when in fullscreen mode. if (window_state->IsFullscreen()) ToggleFullscreen(); diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 3f0c538..c4e6691 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -54,8 +54,8 @@ #include "ash/wm/workspace/snap_sizer.h" #include "base/bind.h" #include "base/command_line.h" +#include "base/metrics/user_metrics.h" #include "content/public/browser/gpu_data_manager.h" -#include "content/public/browser/user_metrics.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/base/accelerators/accelerator.h" @@ -81,8 +81,8 @@ namespace ash { namespace { +using base::UserMetricsAction; using internal::DisplayInfo; -using content::UserMetricsAction; bool DebugShortcutsEnabled() { #if defined(NDEBUG) @@ -95,9 +95,9 @@ bool DebugShortcutsEnabled() { bool HandleAccessibleFocusCycle(bool reverse) { if (reverse) { - content::RecordAction(UserMetricsAction("Accel_Accessible_Focus_Previous")); + base::RecordAction(UserMetricsAction("Accel_Accessible_Focus_Previous")); } else { - content::RecordAction(UserMetricsAction("Accel_Accessible_Focus_Next")); + base::RecordAction(UserMetricsAction("Accel_Accessible_Focus_Next")); } if (!Shell::GetInstance()->accessibility_delegate()-> @@ -128,7 +128,7 @@ bool HandleCycleBackwardMRU(const ui::Accelerator& accelerator) { Shell* shell = Shell::GetInstance(); if (accelerator.key_code() == ui::VKEY_TAB) - content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_Tab")); + base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab")); if (switches::UseOverviewMode()) { shell->window_selector_controller()->HandleCycleWindow( @@ -144,7 +144,7 @@ bool HandleCycleForwardMRU(const ui::Accelerator& accelerator) { Shell* shell = Shell::GetInstance(); if (accelerator.key_code() == ui::VKEY_TAB) - content::RecordAction(content::UserMetricsAction("Accel_NextWindow_Tab")); + base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab")); if (switches::UseOverviewMode()) { shell->window_selector_controller()->HandleCycleWindow( @@ -162,12 +162,12 @@ bool HandleCycleLinear(const ui::Accelerator& accelerator) { // TODO(jamescook): When overview becomes the default the AcceleratorAction // should be renamed from CYCLE_LINEAR to TOGGLE_OVERVIEW. if (switches::UseOverviewMode()) { - content::RecordAction(content::UserMetricsAction("Accel_Overview_F5")); + base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); shell->window_selector_controller()->ToggleOverview(); return true; } if (accelerator.key_code() == ui::VKEY_MEDIA_LAUNCH_APP1) - content::RecordAction(content::UserMetricsAction("Accel_NextWindow_F5")); + base::RecordAction(base::UserMetricsAction("Accel_NextWindow_F5")); shell->window_cycle_controller()->HandleLinearCycleWindow(); return true; } @@ -185,7 +185,7 @@ bool HandleDisableCapsLock(ui::KeyboardCode key_code, // and released, then ignore the release of the Shift key. return false; } - content::RecordAction(UserMetricsAction("Accel_Disable_Caps_Lock")); + base::RecordAction(UserMetricsAction("Accel_Disable_Caps_Lock")); if (shell->caps_lock_delegate()->IsCapsLockEnabled()) { shell->caps_lock_delegate()->SetCapsLockEnabled(false); return true; @@ -195,19 +195,19 @@ bool HandleDisableCapsLock(ui::KeyboardCode key_code, bool HandleFocusLauncher() { Shell* shell = Shell::GetInstance(); - content::RecordAction(content::UserMetricsAction("Accel_Focus_Launcher")); + base::RecordAction(base::UserMetricsAction("Accel_Focus_Launcher")); return shell->focus_cycler()->FocusWidget( Shelf::ForPrimaryDisplay()->shelf_widget()); } bool HandleLaunchAppN(int n) { - content::RecordAction(UserMetricsAction("Accel_Launch_App")); + base::RecordAction(UserMetricsAction("Accel_Launch_App")); Shelf::ForPrimaryDisplay()->LaunchAppIndexAt(n); return true; } bool HandleLaunchLastApp() { - content::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); + base::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); Shelf::ForPrimaryDisplay()->LaunchAppIndexAt(-1); return true; } @@ -252,7 +252,7 @@ bool HandleMediaPrevTrack() { } bool HandleNewIncognitoWindow() { - content::RecordAction(UserMetricsAction("Accel_New_Incognito_Window")); + base::RecordAction(UserMetricsAction("Accel_New_Incognito_Window")); bool incognito_allowed = Shell::GetInstance()->delegate()->IsIncognitoAllowed(); if (incognito_allowed) @@ -263,13 +263,13 @@ bool HandleNewIncognitoWindow() { bool HandleNewTab(ui::KeyboardCode key_code) { if (key_code == ui::VKEY_T) - content::RecordAction(content::UserMetricsAction("Accel_NewTab_T")); + base::RecordAction(base::UserMetricsAction("Accel_NewTab_T")); Shell::GetInstance()->new_window_delegate()->NewTab(); return true; } bool HandleNewWindow() { - content::RecordAction(content::UserMetricsAction("Accel_New_Window")); + base::RecordAction(base::UserMetricsAction("Accel_New_Window")); Shell::GetInstance()->new_window_delegate()->NewWindow( false /* is_incognito */); return true; @@ -295,20 +295,20 @@ bool HandleNextIme(ImeControlDelegate* ime_control_delegate, // TODO(mazda): Fix crbug.com/158217 return false; } - content::RecordAction(UserMetricsAction("Accel_Next_Ime")); + base::RecordAction(UserMetricsAction("Accel_Next_Ime")); if (ime_control_delegate) return ime_control_delegate->HandleNextIme(); return false; } bool HandleOpenFeedbackPage() { - content::RecordAction(UserMetricsAction("Accel_Open_Feedback_Page")); + base::RecordAction(UserMetricsAction("Accel_Open_Feedback_Page")); ash::Shell::GetInstance()->new_window_delegate()->OpenFeedbackPage(); return true; } bool HandlePositionCenter() { - content::RecordAction(UserMetricsAction("Accel_Window_Position_Center")); + base::RecordAction(UserMetricsAction("Accel_Window_Position_Center")); aura::Window* window = wm::GetActiveWindow(); // Docked windows do not support centering and ignore accelerator. if (window && !wm::GetWindowState(window)->IsDocked()) { @@ -320,14 +320,14 @@ bool HandlePositionCenter() { bool HandlePreviousIme(ImeControlDelegate* ime_control_delegate, const ui::Accelerator& accelerator) { - content::RecordAction(UserMetricsAction("Accel_Previous_Ime")); + base::RecordAction(UserMetricsAction("Accel_Previous_Ime")); if (ime_control_delegate) return ime_control_delegate->HandlePreviousIme(accelerator); return false; } bool HandleRestoreTab() { - content::RecordAction(content::UserMetricsAction("Accel_Restore_Tab")); + base::RecordAction(base::UserMetricsAction("Accel_Restore_Tab")); Shell::GetInstance()->new_window_delegate()->RestoreTab(); return true; } @@ -337,12 +337,12 @@ bool HandleRotatePaneFocus(Shell::Direction direction) { switch (direction) { // TODO(stevet): Not sure if this is the same as IDC_FOCUS_NEXT_PANE. case Shell::FORWARD: { - content::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane")); + base::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane")); shell->focus_cycler()->RotateFocus(internal::FocusCycler::FORWARD); break; } case Shell::BACKWARD: { - content::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane")); + base::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane")); shell->focus_cycler()->RotateFocus(internal::FocusCycler::BACKWARD); break; } @@ -352,7 +352,7 @@ bool HandleRotatePaneFocus(Shell::Direction direction) { // Rotate the active window. bool HandleRotateActiveWindow() { - content::RecordAction(UserMetricsAction("Accel_Rotate_Window")); + base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); aura::Window* active_window = wm::GetActiveWindow(); if (active_window) { // The rotation animation bases its target transform on the current @@ -385,7 +385,7 @@ gfx::Display::Rotation GetNextRotation(gfx::Display::Rotation current) { // Rotates the screen. bool HandleRotateScreen() { - content::RecordAction(UserMetricsAction("Accel_Rotate_Window")); + base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); gfx::Point point = Shell::GetScreen()->GetCursorScreenPoint(); gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint(point); const DisplayInfo& display_info = @@ -402,7 +402,7 @@ bool HandleScaleReset() { if (display_id == gfx::Display::kInvalidDisplayID) return false; - content::RecordAction(UserMetricsAction("Accel_Scale_Ui_Reset")); + base::RecordAction(UserMetricsAction("Accel_Scale_Ui_Reset")); display_manager->SetDisplayUIScale(display_id, 1.0f); return true; @@ -416,9 +416,9 @@ bool HandleScaleUI(bool up) { return false; if (up) { - content::RecordAction(UserMetricsAction("Accel_Scale_Ui_Up")); + base::RecordAction(UserMetricsAction("Accel_Scale_Ui_Up")); } else { - content::RecordAction(UserMetricsAction("Accel_Scale_Ui_Down")); + base::RecordAction(UserMetricsAction("Accel_Scale_Ui_Down")); } const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id); @@ -429,20 +429,20 @@ bool HandleScaleUI(bool up) { } bool HandleSwapPrimaryDisplay() { - content::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); + base::RecordAction(UserMetricsAction("Accel_Swap_Primary_Display")); Shell::GetInstance()->display_controller()->SwapPrimaryDisplay(); return true; } bool HandleShowKeyboardOverlay() { - content::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); + base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); return true; } void HandleShowMessageCenterBubble() { - content::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); + base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); internal::RootWindowController* controller = internal::RootWindowController::ForTargetRootWindow(); internal::StatusAreaWidget* status_area_widget = @@ -465,7 +465,7 @@ bool HandleShowOak() { } bool HandleShowSystemTrayBubble() { - content::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); + base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); internal::RootWindowController* controller = internal::RootWindowController::ForTargetRootWindow(); if (!controller->GetSystemTray()->HasSystemBubble()) { @@ -476,13 +476,13 @@ bool HandleShowSystemTrayBubble() { } bool HandleShowTaskManager() { - content::RecordAction(UserMetricsAction("Accel_Show_Task_Manager")); + base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager")); Shell::GetInstance()->new_window_delegate()->ShowTaskManager(); return true; } void HandleSilenceSpokenFeedback() { - content::RecordAction(UserMetricsAction("Accel_Silence_Spoken_Feedback")); + base::RecordAction(UserMetricsAction("Accel_Silence_Spoken_Feedback")); AccessibilityDelegate* delegate = Shell::GetInstance()->accessibility_delegate(); @@ -493,14 +493,14 @@ void HandleSilenceSpokenFeedback() { bool HandleSwitchIme(ImeControlDelegate* ime_control_delegate, const ui::Accelerator& accelerator) { - content::RecordAction(UserMetricsAction("Accel_Switch_Ime")); + base::RecordAction(UserMetricsAction("Accel_Switch_Ime")); if (ime_control_delegate) return ime_control_delegate->HandleSwitchIme(accelerator); return false; } bool HandleTakePartialScreenshot(ScreenshotDelegate* screenshot_delegate) { - content::RecordAction(UserMetricsAction("Accel_Take_Partial_Screenshot")); + base::RecordAction(UserMetricsAction("Accel_Take_Partial_Screenshot")); if (screenshot_delegate) { ash::PartialScreenshotView::StartPartialScreenshot( screenshot_delegate); @@ -511,7 +511,7 @@ bool HandleTakePartialScreenshot(ScreenshotDelegate* screenshot_delegate) { } bool HandleTakeScreenshot(ScreenshotDelegate* screenshot_delegate) { - content::RecordAction(UserMetricsAction("Accel_Take_Screenshot")); + base::RecordAction(UserMetricsAction("Accel_Take_Screenshot")); if (screenshot_delegate && screenshot_delegate->CanTakeScreenshot()) { screenshot_delegate->HandleTakeScreenshotForAllRootWindows(); @@ -532,7 +532,7 @@ bool HandleToggleAppList(ui::KeyboardCode key_code, previous_key_code != ui::VKEY_LWIN)) return false; if (key_code == ui::VKEY_LWIN) - content::RecordAction(content::UserMetricsAction("Accel_Search_LWin")); + base::RecordAction(base::UserMetricsAction("Accel_Search_LWin")); // When spoken feedback is enabled, we should neither toggle the list nor // consume the key since Search+Shift is one of the shortcuts the a11y // feature uses. crbug.com/132296 @@ -557,14 +557,14 @@ bool HandleToggleCapsLock(ui::KeyboardCode key_code, previous_key_code != ui::VKEY_LWIN) return false; } - content::RecordAction(UserMetricsAction("Accel_Toggle_Caps_Lock")); + base::RecordAction(UserMetricsAction("Accel_Toggle_Caps_Lock")); shell->caps_lock_delegate()->ToggleCapsLock(); return true; } bool HandleToggleFullscreen(ui::KeyboardCode key_code) { if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) { - content::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); + base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); } accelerators::ToggleFullscreen(); return true; @@ -586,9 +586,9 @@ bool HandleWindowSnap(int action) { } if (action == WINDOW_SNAP_LEFT) { - content::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); + base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); } else { - content::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); + base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); } internal::SnapSizer::SnapWindow(window_state, @@ -598,34 +598,34 @@ bool HandleWindowSnap(int action) { } bool HandleWindowMinimize() { - content::RecordAction( - content::UserMetricsAction("Accel_Toggle_Minimized_Minus")); + base::RecordAction( + base::UserMetricsAction("Accel_Toggle_Minimized_Minus")); return accelerators::ToggleMinimized(); } #if defined(OS_CHROMEOS) bool HandleAddRemoveDisplay() { - content::RecordAction(UserMetricsAction("Accel_Add_Remove_Display")); + base::RecordAction(UserMetricsAction("Accel_Add_Remove_Display")); Shell::GetInstance()->display_manager()->AddRemoveDisplay(); return true; } bool HandleCrosh() { - content::RecordAction(UserMetricsAction("Accel_Open_Crosh")); + base::RecordAction(UserMetricsAction("Accel_Open_Crosh")); Shell::GetInstance()->new_window_delegate()->OpenCrosh(); return true; } bool HandleFileManager() { - content::RecordAction(UserMetricsAction("Accel_Open_File_Manager")); + base::RecordAction(UserMetricsAction("Accel_Open_File_Manager")); Shell::GetInstance()->new_window_delegate()->OpenFileManager(); return true; } bool HandleLock(ui::KeyboardCode key_code) { - content::RecordAction(UserMetricsAction("Accel_LockScreen_L")); + base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); Shell::GetInstance()->session_state_delegate()->LockScreen(); return true; } @@ -641,10 +641,10 @@ bool HandleCycleUser(SessionStateDelegate::CycleUser cycle_user) { MultiProfileUMA::SWITCH_ACTIVE_USER_BY_ACCELERATOR); switch (cycle_user) { case SessionStateDelegate::CYCLE_TO_NEXT_USER: - content::RecordAction(UserMetricsAction("Accel_Switch_To_Next_User")); + base::RecordAction(UserMetricsAction("Accel_Switch_To_Next_User")); break; case SessionStateDelegate::CYCLE_TO_PREVIOUS_USER: - content::RecordAction(UserMetricsAction("Accel_Switch_To_Previous_User")); + base::RecordAction(UserMetricsAction("Accel_Switch_To_Previous_User")); break; } delegate->CycleActiveUser(cycle_user); @@ -652,13 +652,13 @@ bool HandleCycleUser(SessionStateDelegate::CycleUser cycle_user) { } bool HandleToggleMirrorMode() { - content::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode")); + base::RecordAction(UserMetricsAction("Accel_Toggle_Mirror_Mode")); Shell::GetInstance()->display_controller()->ToggleMirrorMode(); return true; } bool HandleToggleSpokenFeedback() { - content::RecordAction(UserMetricsAction("Accel_Toggle_Spoken_Feedback")); + base::RecordAction(UserMetricsAction("Accel_Toggle_Spoken_Feedback")); Shell::GetInstance()->accessibility_delegate()-> ToggleSpokenFeedback(A11Y_NOTIFICATION_SHOW); @@ -686,7 +686,7 @@ bool HandleTouchHudModeChange() { } bool HandleTouchHudProjectToggle() { - content::RecordAction(UserMetricsAction("Accel_Touch_Hud_Clear")); + base::RecordAction(UserMetricsAction("Accel_Touch_Hud_Clear")); bool enabled = Shell::GetInstance()->is_touch_hud_projection_enabled(); Shell::GetInstance()->SetTouchHudProjectionEnabled(!enabled); return true; diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc index fdf1663..7e46801 100644 --- a/ash/metrics/user_metrics_recorder.cc +++ b/ash/metrics/user_metrics_recorder.cc @@ -10,7 +10,7 @@ #include "ash/shell.h" #include "ash/wm/window_state.h" #include "base/metrics/histogram.h" -#include "content/public/browser/user_metrics.h" +#include "base/metrics/user_metrics.h" namespace ash { @@ -31,330 +31,330 @@ UserMetricsRecorder::~UserMetricsRecorder() { void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) { switch (action) { case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6: - content::RecordAction( - content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); + base::RecordAction( + base::UserMetricsAction("Accel_KeyboardBrightnessDown_F6")); break; case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7: - content::RecordAction( - content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); + base::RecordAction( + base::UserMetricsAction("Accel_KeyboardBrightnessUp_F7")); break; case ash::UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON: - content::RecordAction( - content::UserMetricsAction("Accel_LockScreen_LockButton")); + base::RecordAction( + base::UserMetricsAction("Accel_LockScreen_LockButton")); break; case ash::UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON: - content::RecordAction( - content::UserMetricsAction("Accel_LockScreen_PowerButton")); + base::RecordAction( + base::UserMetricsAction("Accel_LockScreen_PowerButton")); break; case ash::UMA_ACCEL_MAXIMIZE_RESTORE_F4: - content::RecordAction( - content::UserMetricsAction("Accel_Maximize_Restore_F4")); + base::RecordAction( + base::UserMetricsAction("Accel_Maximize_Restore_F4")); break; case ash::UMA_ACCEL_PREVWINDOW_F5: - content::RecordAction(content::UserMetricsAction("Accel_PrevWindow_F5")); + base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_F5")); break; case ash::UMA_ACCEL_EXIT_FIRST_Q: - content::RecordAction(content::UserMetricsAction("Accel_Exit_First_Q")); + base::RecordAction(base::UserMetricsAction("Accel_Exit_First_Q")); break; case ash::UMA_ACCEL_EXIT_SECOND_Q: - content::RecordAction(content::UserMetricsAction("Accel_Exit_Second_Q")); + base::RecordAction(base::UserMetricsAction("Accel_Exit_Second_Q")); break; case ash::UMA_ACCEL_SHUT_DOWN_POWER_BUTTON: - content::RecordAction( - content::UserMetricsAction("Accel_ShutDown_PowerButton")); + base::RecordAction( + base::UserMetricsAction("Accel_ShutDown_PowerButton")); break; case ash::UMA_CLOSE_THROUGH_CONTEXT_MENU: - content::RecordAction(content::UserMetricsAction("CloseFromContextMenu")); + base::RecordAction(base::UserMetricsAction("CloseFromContextMenu")); break; case ash::UMA_GESTURE_OVERVIEW: - content::RecordAction(content::UserMetricsAction("Gesture_Overview")); + base::RecordAction(base::UserMetricsAction("Gesture_Overview")); break; case ash::UMA_LAUNCHER_CLICK_ON_APP: - content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp")); + base::RecordAction(base::UserMetricsAction("Launcher_ClickOnApp")); break; case ash::UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON: - content::RecordAction( - content::UserMetricsAction("Launcher_ClickOnApplistButton")); + base::RecordAction( + base::UserMetricsAction("Launcher_ClickOnApplistButton")); break; case ash::UMA_MOUSE_DOWN: - content::RecordAction(content::UserMetricsAction("Mouse_Down")); + base::RecordAction(base::UserMetricsAction("Mouse_Down")); break; case ash::UMA_SHELF_ALIGNMENT_SET_BOTTOM: - content::RecordAction( - content::UserMetricsAction("Shelf_AlignmentSetBottom")); + base::RecordAction( + base::UserMetricsAction("Shelf_AlignmentSetBottom")); break; case ash::UMA_SHELF_ALIGNMENT_SET_LEFT: - content::RecordAction( - content::UserMetricsAction("Shelf_AlignmentSetLeft")); + base::RecordAction( + base::UserMetricsAction("Shelf_AlignmentSetLeft")); break; case ash::UMA_SHELF_ALIGNMENT_SET_RIGHT: - content::RecordAction( - content::UserMetricsAction("Shelf_AlignmentSetRight")); + base::RecordAction( + base::UserMetricsAction("Shelf_AlignmentSetRight")); case ash::UMA_STATUS_AREA_AUDIO_CURRENT_INPUT_DEVICE: - content::RecordAction( - content::UserMetricsAction("StatusArea_Audio_CurrentInputDevice")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Audio_CurrentInputDevice")); break; case ash::UMA_STATUS_AREA_AUDIO_CURRENT_OUTPUT_DEVICE: - content::RecordAction( - content::UserMetricsAction("StatusArea_Audio_CurrentOutputDevice")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Audio_CurrentOutputDevice")); break; case ash::UMA_STATUS_AREA_AUDIO_SWITCH_INPUT_DEVICE: - content::RecordAction( - content::UserMetricsAction("StatusArea_Audio_SwitchInputDevice")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Audio_SwitchInputDevice")); break; case ash::UMA_STATUS_AREA_AUDIO_SWITCH_OUTPUT_DEVICE: - content::RecordAction( - content::UserMetricsAction("StatusArea_Audio_SwitchOutputDevice")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Audio_SwitchOutputDevice")); break; case ash::UMA_STATUS_AREA_BRIGHTNESS_CHANGED: - content::RecordAction( - content::UserMetricsAction("StatusArea_BrightnessChanged")); + base::RecordAction( + base::UserMetricsAction("StatusArea_BrightnessChanged")); break; case ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_KNOWN_DEVICE: - content::RecordAction( - content::UserMetricsAction("StatusArea_Bluetooth_Connect_Known")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Bluetooth_Connect_Known")); break; case ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_UNKNOWN_DEVICE: - content::RecordAction( - content::UserMetricsAction("StatusArea_Bluetooth_Connect_Unknown")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Bluetooth_Connect_Unknown")); break; case ash::UMA_STATUS_AREA_BLUETOOTH_DISABLED: - content::RecordAction( - content::UserMetricsAction("StatusArea_Bluetooth_Disabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Bluetooth_Disabled")); break; case ash::UMA_STATUS_AREA_BLUETOOTH_ENABLED: - content::RecordAction( - content::UserMetricsAction("StatusArea_Bluetooth_Enabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Bluetooth_Enabled")); break; case ash::UMA_STATUS_AREA_CAPS_LOCK_DETAILED: - content::RecordAction( - content::UserMetricsAction("StatusArea_CapsLock_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_CapsLock_Detailed")); break; case ash::UMA_STATUS_AREA_CAPS_LOCK_DISABLED_BY_CLICK: - content::RecordAction( - content::UserMetricsAction("StatusArea_CapsLock_DisabledByClick")); + base::RecordAction( + base::UserMetricsAction("StatusArea_CapsLock_DisabledByClick")); break; case ash::UMA_STATUS_AREA_CAPS_LOCK_ENABLED_BY_CLICK: - content::RecordAction( - content::UserMetricsAction("StatusArea_CapsLock_EnabledByClick")); + base::RecordAction( + base::UserMetricsAction("StatusArea_CapsLock_EnabledByClick")); break; case ash::UMA_STATUS_AREA_CAPS_LOCK_POPUP: - content::RecordAction( - content::UserMetricsAction("StatusArea_CapsLock_Popup")); + base::RecordAction( + base::UserMetricsAction("StatusArea_CapsLock_Popup")); break; case ash::UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_ConnectConfigured")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_ConnectConfigured")); break; case ash::UMA_STATUS_AREA_CONNECT_TO_UNCONFIGURED_NETWORK: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_ConnectUnconfigured")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_ConnectUnconfigured")); break; case ash::UMA_STATUS_AREA_CONNECT_TO_VPN: - content::RecordAction( - content::UserMetricsAction("StatusArea_VPN_ConnectToNetwork")); + base::RecordAction( + base::UserMetricsAction("StatusArea_VPN_ConnectToNetwork")); break; case ash::UMA_STATUS_AREA_CHANGED_VOLUME_MENU: - content::RecordAction( - content::UserMetricsAction("StatusArea_Volume_ChangedMenu")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Volume_ChangedMenu")); break; case ash::UMA_STATUS_AREA_CHANGED_VOLUME_POPUP: - content::RecordAction( - content::UserMetricsAction("StatusArea_Volume_ChangedPopup")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Volume_ChangedPopup")); break; case ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY: - content::RecordAction( - content::UserMetricsAction("StatusArea_Accessability_DetailedView")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Accessability_DetailedView")); break; case ash::UMA_STATUS_AREA_DETAILED_AUDIO_VIEW: - content::RecordAction( - content::UserMetricsAction("StatusArea_Audio_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Audio_Detailed")); break; case ash::UMA_STATUS_AREA_DETAILED_BLUETOOTH_VIEW: - content::RecordAction( - content::UserMetricsAction("StatusArea_Bluetooth_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Bluetooth_Detailed")); break; case ash::UMA_STATUS_AREA_DETAILED_BRIGHTNESS_VIEW: - content::RecordAction( - content::UserMetricsAction("StatusArea_Brightness_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Brightness_Detailed")); break; case ash::UMA_STATUS_AREA_DETAILED_DRIVE_VIEW: - content::RecordAction( - content::UserMetricsAction("StatusArea_Drive_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Drive_Detailed")); break; case ash::UMA_STATUS_AREA_DETAILED_NETWORK_VIEW: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_Detailed")); break; case ash::UMA_STATUS_AREA_DETAILED_VPN_VIEW: - content::RecordAction( - content::UserMetricsAction("StatusArea_VPN_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_VPN_Detailed")); break; case ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK: - content::RecordAction( - content::UserMetricsAction("StatusArea_AutoClickDisabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_AutoClickDisabled")); break; case ash::UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST: - content::RecordAction( - content::UserMetricsAction("StatusArea_HighContrastDisabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_HighContrastDisabled")); break; case ash::UMA_STATUS_AREA_DISABLE_LARGE_CURSOR: - content::RecordAction( - content::UserMetricsAction("StatusArea_LargeCursorDisabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_LargeCursorDisabled")); break; case ash::UMA_STATUS_AREA_DISABLE_MAGNIFIER: - content::RecordAction( - content::UserMetricsAction("StatusArea_MagnifierDisabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_MagnifierDisabled")); break; case ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK: - content::RecordAction( - content::UserMetricsAction("StatusArea_SpokenFeedbackDisabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_SpokenFeedbackDisabled")); break; case ash::UMA_STATUS_AREA_DISABLE_WIFI: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_WifiDisabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_WifiDisabled")); break; case ash::UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION: - content::RecordAction( - content::UserMetricsAction("StatusArea_Drive_CancelOperation")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Drive_CancelOperation")); break; case ash::UMA_STATUS_AREA_DRIVE_SETTINGS: - content::RecordAction( - content::UserMetricsAction("StatusArea_Drive_Settings")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Drive_Settings")); break; case ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK: - content::RecordAction( - content::UserMetricsAction("StatusArea_AutoClickEnabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_AutoClickEnabled")); break; case ash::UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST: - content::RecordAction( - content::UserMetricsAction("StatusArea_HighContrastEnabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_HighContrastEnabled")); break; case ash::UMA_STATUS_AREA_ENABLE_LARGE_CURSOR: - content::RecordAction( - content::UserMetricsAction("StatusArea_LargeCursorEnabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_LargeCursorEnabled")); break; case ash::UMA_STATUS_AREA_ENABLE_MAGNIFIER: - content::RecordAction( - content::UserMetricsAction("StatusArea_MagnifierEnabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_MagnifierEnabled")); break; case ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK: - content::RecordAction( - content::UserMetricsAction("StatusArea_SpokenFeedbackEnabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_SpokenFeedbackEnabled")); break; case ash::UMA_STATUS_AREA_ENABLE_WIFI: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_WifiEnabled")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_WifiEnabled")); break; case ash::UMA_STATUS_AREA_IME_SHOW_DETAILED: - content::RecordAction( - content::UserMetricsAction("StatusArea_IME_Detailed")); + base::RecordAction( + base::UserMetricsAction("StatusArea_IME_Detailed")); break; case ash::UMA_STATUS_AREA_IME_SWITCH_MODE: - content::RecordAction( - content::UserMetricsAction("StatusArea_IME_SwitchMode")); + base::RecordAction( + base::UserMetricsAction("StatusArea_IME_SwitchMode")); break; case ash::UMA_STATUS_AREA_MENU_OPENED: - content::RecordAction( - content::UserMetricsAction("StatusArea_MenuOpened")); + base::RecordAction( + base::UserMetricsAction("StatusArea_MenuOpened")); break; case ash::UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_JoinOther")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_JoinOther")); break; case ash::UMA_STATUS_AREA_NETWORK_SETTINGS_CLICKED: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_Settings")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_Settings")); break; case ash::UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS: - content::RecordAction( - content::UserMetricsAction("StatusArea_Network_ConnectionDetails")); + base::RecordAction( + base::UserMetricsAction("StatusArea_Network_ConnectionDetails")); break; case ash::UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS: - content::RecordAction( - content::UserMetricsAction("StatusArea_VPN_ConnectionDetails")); + base::RecordAction( + base::UserMetricsAction("StatusArea_VPN_ConnectionDetails")); break; case ash::UMA_STATUS_AREA_SIGN_OUT: - content::RecordAction( - content::UserMetricsAction("StatusArea_SignOut")); + base::RecordAction( + base::UserMetricsAction("StatusArea_SignOut")); break; case ash::UMA_STATUS_AREA_VPN_JOIN_OTHER_CLICKED: - content::RecordAction( - content::UserMetricsAction("StatusArea_VPN_JoinOther")); + base::RecordAction( + base::UserMetricsAction("StatusArea_VPN_JoinOther")); break; case ash::UMA_STATUS_AREA_VPN_SETTINGS_CLICKED: - content::RecordAction( - content::UserMetricsAction("StatusArea_VPN_Settings")); + base::RecordAction( + base::UserMetricsAction("StatusArea_VPN_Settings")); break; case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK: - content::RecordAction( - content::UserMetricsAction("Caption_ClickTogglesMaximize")); + base::RecordAction( + base::UserMetricsAction("Caption_ClickTogglesMaximize")); break; case ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE: - content::RecordAction( - content::UserMetricsAction("Caption_GestureTogglesMaximize")); + base::RecordAction( + base::UserMetricsAction("Caption_GestureTogglesMaximize")); break; case ash::UMA_TOUCHPAD_GESTURE_OVERVIEW: - content::RecordAction( - content::UserMetricsAction("Touchpad_Gesture_Overview")); + base::RecordAction( + base::UserMetricsAction("Touchpad_Gesture_Overview")); break; case ash::UMA_TOUCHSCREEN_TAP_DOWN: - content::RecordAction(content::UserMetricsAction("Touchscreen_Down")); + base::RecordAction(base::UserMetricsAction("Touchscreen_Down")); break; case ash::UMA_TRAY_HELP: - content::RecordAction(content::UserMetricsAction("Tray_Help")); + base::RecordAction(base::UserMetricsAction("Tray_Help")); break; case ash::UMA_TRAY_LOCK_SCREEN: - content::RecordAction(content::UserMetricsAction("Tray_LockScreen")); + base::RecordAction(base::UserMetricsAction("Tray_LockScreen")); break; case ash::UMA_TRAY_SHUT_DOWN: - content::RecordAction(content::UserMetricsAction("Tray_ShutDown")); + base::RecordAction(base::UserMetricsAction("Tray_ShutDown")); break; case ash::UMA_WINDOW_APP_CLOSE_BUTTON_CLICK: - content::RecordAction(content::UserMetricsAction("AppCloseButton_Clk")); + base::RecordAction(base::UserMetricsAction("AppCloseButton_Clk")); break; case ash::UMA_WINDOW_CLOSE_BUTTON_CLICK: - content::RecordAction(content::UserMetricsAction("CloseButton_Clk")); + base::RecordAction(base::UserMetricsAction("CloseButton_Clk")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN: - content::RecordAction(content::UserMetricsAction("MaxButton_Clk_ExitFS")); + base::RecordAction(base::UserMetricsAction("MaxButton_Clk_ExitFS")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE: - content::RecordAction( - content::UserMetricsAction("MaxButton_Clk_Restore")); + base::RecordAction( + base::UserMetricsAction("MaxButton_Clk_Restore")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE: - content::RecordAction( - content::UserMetricsAction("MaxButton_Clk_Maximize")); + base::RecordAction( + base::UserMetricsAction("MaxButton_Clk_Maximize")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE: - content::RecordAction(content::UserMetricsAction("MinButton_Clk")); + base::RecordAction(base::UserMetricsAction("MinButton_Clk")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE: - content::RecordAction(content::UserMetricsAction("MaxButton_Maximize")); + base::RecordAction(base::UserMetricsAction("MaxButton_Maximize")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT: - content::RecordAction(content::UserMetricsAction("MaxButton_MaxLeft")); + base::RecordAction(base::UserMetricsAction("MaxButton_MaxLeft")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT: - content::RecordAction(content::UserMetricsAction("MaxButton_MaxRight")); + base::RecordAction(base::UserMetricsAction("MaxButton_MaxRight")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE: - content::RecordAction(content::UserMetricsAction("MaxButton_Minimize")); + base::RecordAction(base::UserMetricsAction("MaxButton_Minimize")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE: - content::RecordAction(content::UserMetricsAction("MaxButton_Restore")); + base::RecordAction(base::UserMetricsAction("MaxButton_Restore")); break; case ash::UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE: - content::RecordAction(content::UserMetricsAction("MaxButton_ShowBubble")); + base::RecordAction(base::UserMetricsAction("MaxButton_ShowBubble")); break; case ash::UMA_WINDOW_OVERVIEW: - content::RecordAction( - content::UserMetricsAction("WindowSelector_Overview")); + base::RecordAction( + base::UserMetricsAction("WindowSelector_Overview")); break; case ash::UMA_WINDOW_SELECTION: - content::RecordAction( - content::UserMetricsAction("WindowSelector_Selection")); + base::RecordAction( + base::UserMetricsAction("WindowSelector_Selection")); break; } } diff --git a/ash/system/chromeos/brightness/brightness_controller_chromeos.cc b/ash/system/chromeos/brightness/brightness_controller_chromeos.cc index 78d35df..d0e5600 100644 --- a/ash/system/chromeos/brightness/brightness_controller_chromeos.cc +++ b/ash/system/chromeos/brightness/brightness_controller_chromeos.cc @@ -4,9 +4,9 @@ #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h" +#include "base/metrics/user_metrics.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power_manager_client.h" -#include "content/public/browser/user_metrics.h" #include "ui/base/accelerators/accelerator.h" namespace ash { @@ -15,8 +15,8 @@ namespace system { bool BrightnessControllerChromeos::HandleBrightnessDown( const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_DOWN) - content::RecordAction( - content::UserMetricsAction("Accel_BrightnessDown_F6")); + base::RecordAction( + base::UserMetricsAction("Accel_BrightnessDown_F6")); chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> DecreaseScreenBrightness(true); @@ -26,7 +26,7 @@ bool BrightnessControllerChromeos::HandleBrightnessDown( bool BrightnessControllerChromeos::HandleBrightnessUp( const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_UP) - content::RecordAction(content::UserMetricsAction("Accel_BrightnessUp_F7")); + base::RecordAction(base::UserMetricsAction("Accel_BrightnessUp_F7")); chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> IncreaseScreenBrightness(); diff --git a/base/base.gypi b/base/base.gypi index f5db573..c593ac0 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -381,6 +381,9 @@ 'metrics/stats_counters.h', 'metrics/stats_table.cc', 'metrics/stats_table.h', + 'metrics/user_metrics.cc', + 'metrics/user_metrics.h', + 'metrics/user_metrics_action.h', 'move.h', 'native_library.h', 'native_library_mac.mm', diff --git a/base/metrics/user_metrics.cc b/base/metrics/user_metrics.cc new file mode 100644 index 0000000..a3b122a --- /dev/null +++ b/base/metrics/user_metrics.cc @@ -0,0 +1,45 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/metrics/user_metrics.h" + +#include <vector> + +#include "base/lazy_instance.h" + +namespace base { +namespace { + +base::LazyInstance<std::vector<ActionCallback> > g_action_callbacks = + LAZY_INSTANCE_INITIALIZER; + +void Record(const char *action) { + for (size_t i = 0; i < g_action_callbacks.Get().size(); i++) + g_action_callbacks.Get()[i].Run(action); +} + +} // namespace + +void RecordAction(const UserMetricsAction& action) { + Record(action.str_); +} + +void RecordComputedAction(const std::string& action) { + Record(action.c_str()); +} + +void AddActionCallback(const ActionCallback& callback) { + g_action_callbacks.Get().push_back(callback); +} + +void RemoveActionCallback(const ActionCallback& callback) { + for (size_t i = 0; i < g_action_callbacks.Get().size(); i++) { + if (g_action_callbacks.Get()[i].Equals(callback)) { + g_action_callbacks.Get().erase(g_action_callbacks.Get().begin() + i); + return; + } + } +} + +} // namespace base diff --git a/base/metrics/user_metrics.h b/base/metrics/user_metrics.h new file mode 100644 index 0000000..10e7d3c --- /dev/null +++ b/base/metrics/user_metrics.h @@ -0,0 +1,57 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_METRICS_USER_METRICS_H_ +#define BASE_METRICS_USER_METRICS_H_ + +#include <string> + +#include "base/base_export.h" +#include "base/callback.h" +#include "base/metrics/user_metrics_action.h" + +namespace base { + +// This module provides some helper functions for logging actions tracked by +// the user metrics system. + +// Record that the user performed an action. +// "Action" here means a user-generated event: +// good: "Reload", "CloseTab", and "IMEInvoked" +// not good: "SSLDialogShown", "PageLoaded", "DiskFull" +// We use this to gather anonymized information about how users are +// interacting with the browser. +// WARNING: In calls to this function, UserMetricsAction and a +// string literal parameter must be on the same line, e.g. +// RecordAction(UserMetricsAction("my extremely long action name")); +// This ensures that our processing scripts can associate this action's hash +// with its metric name. Therefore, it will be possible to retrieve the metric +// name from the hash later on. +// +// Once a new recorded action is added, run +// tools/metrics/actions/extract_actions.py --hash +// to generate a new mapping of [action hashes -> metric names] and send it +// out for review to be updated. +// +// For more complicated situations (like when there are many different +// possible actions), see RecordComputedAction. +BASE_EXPORT void RecordAction(const UserMetricsAction& action); + +// This function has identical input and behavior to RecordAction, but is +// not automatically found by the action-processing scripts. It can be used +// when it's a pain to enumerate all possible actions, but if you use this +// you need to also update the rules for extracting known actions in +// tools/metrics/actions/extract_actions.py. +BASE_EXPORT void RecordComputedAction(const std::string& action); + +// Called with the action string. +typedef base::Callback<void(const std::string&)> ActionCallback; + +// Add/remove action callbacks (see above). +BASE_EXPORT void AddActionCallback(const ActionCallback& callback); +BASE_EXPORT void RemoveActionCallback(const ActionCallback& callback); + +} // namespace base + +#endif // BASE_METRICS_USER_METRICS_H_ diff --git a/content/public/common/user_metrics_action.h b/base/metrics/user_metrics_action.h index 3b604ef..8c195b3 100644 --- a/content/public/common/user_metrics_action.h +++ b/base/metrics/user_metrics_action.h @@ -1,19 +1,18 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_PUBLIC_COMMON_USER_METRICS_ACTION_H_ -#define CONTENT_PUBLIC_COMMON_USER_METRICS_ACTION_H_ +#ifndef BASE_METRICS_USER_METRICS_ACTION_H_ +#define BASE_METRICS_USER_METRICS_ACTION_H_ -namespace content { +namespace base { // UserMetricsAction exists purely to standardize on the parameters passed to // UserMetrics. That way, our toolset can scan the source code reliable for // constructors and extract the associated string constants. // WARNING: When using UserMetricsAction, UserMetricsAction and a string literal // parameter must be on the same line, e.g. -// RecordAction( -// UserMetricsAction("my extremely long action name")); +// RecordAction(UserMetricsAction("my extremely long action name")); // or // RenderThread::Get()->RecordAction( // UserMetricsAction("my extremely long action name")); @@ -24,6 +23,6 @@ struct UserMetricsAction { explicit UserMetricsAction(const char* str) : str_(str) {} }; -} // namespace content +} // namespace base -#endif // CONTENT_PUBLIC_COMMON_USER_METRICS_ACTION_H_ +#endif // BASE_METRICS_USER_METRICS_ACTION_H_ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 4dddf95..0cff114 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -53,7 +53,7 @@ #include "ui/app_list/app_list_switches.h" #endif -using content::UserMetricsAction; +using base::UserMetricsAction; namespace about_flags { diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc index ea767cd..05763f7 100644 --- a/chrome/browser/android/shortcut_helper.cc +++ b/chrome/browser/android/shortcut_helper.cc @@ -184,15 +184,15 @@ void ShortcutHelper::AddShortcutInBackground( switch (shortcut_type) { case ShortcutBuilder::APP_SHORTCUT: content::RecordAction( - content::UserMetricsAction("webapps.AddShortcut.AppShortcut")); + base::UserMetricsAction("webapps.AddShortcut.AppShortcut")); break; case ShortcutBuilder::APP_SHORTCUT_APPLE: content::RecordAction( - content::UserMetricsAction("webapps.AddShortcut.AppShortcutApple")); + base::UserMetricsAction("webapps.AddShortcut.AppShortcutApple")); break; case ShortcutBuilder::BOOKMARK: content::RecordAction( - content::UserMetricsAction("webapps.AddShortcut.Bookmark")); + base::UserMetricsAction("webapps.AddShortcut.Bookmark")); break; default: NOTREACHED(); diff --git a/chrome/browser/android/uma_bridge.cc b/chrome/browser/android/uma_bridge.cc index 3900c8e..614b626 100644 --- a/chrome/browser/android/uma_bridge.cc +++ b/chrome/browser/android/uma_bridge.cc @@ -9,9 +9,9 @@ #include "content/public/browser/user_metrics.h" #include "jni/UmaBridge_jni.h" +using base::UserMetricsAction; using content::RecordAction; using content::RecordComputedAction; -using content::UserMetricsAction; static void RecordMenuShow(JNIEnv*, jclass) { RecordAction(UserMetricsAction("MobileMenuShow")); diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 79b2d89..5cb4af3 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -92,10 +92,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_mac.h" +using base::UserMetricsAction; using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index d399f6d..df5cffc 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -762,10 +762,10 @@ void SearchProvider::OnDeletionComplete(bool success, void SearchProvider::RecordDeletionResult(bool success) { if (success) { content::RecordAction( - content::UserMetricsAction("Omnibox.ServerSuggestDelete.Success")); + base::UserMetricsAction("Omnibox.ServerSuggestDelete.Success")); } else { content::RecordAction( - content::UserMetricsAction("Omnibox.ServerSuggestDelete.Failure")); + base::UserMetricsAction("Omnibox.ServerSuggestDelete.Failure")); } } diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc index 0df7a3e..36ca602 100644 --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc @@ -49,7 +49,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using extensions::Extension; using extensions::UpdatedExtensionPermissionsInfo; diff --git a/chrome/browser/bookmarks/bookmark_stats.cc b/chrome/browser/bookmarks/bookmark_stats.cc index 1ac8bd3..a95dcdc 100644 --- a/chrome/browser/bookmarks/bookmark_stats.cc +++ b/chrome/browser/bookmarks/bookmark_stats.cc @@ -13,7 +13,7 @@ void RecordBookmarkLaunch(const BookmarkNode* node, if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR || location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) { content::RecordAction( - content::UserMetricsAction("ClickedBookmarkBarURLButton")); + base::UserMetricsAction("ClickedBookmarkBarURLButton")); } UMA_HISTOGRAM_ENUMERATION( "Bookmarks.LaunchLocation", location, BOOKMARK_LAUNCH_LOCATION_LIMIT); @@ -36,7 +36,7 @@ void RecordBookmarkFolderOpen(BookmarkLaunchLocation location) { if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR || location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) { content::RecordAction( - content::UserMetricsAction("ClickedBookmarkBarFolder")); + base::UserMetricsAction("ClickedBookmarkBarFolder")); } } @@ -44,6 +44,6 @@ void RecordBookmarkAppsPageOpen(BookmarkLaunchLocation location) { if (location == BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR || location == BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR) { content::RecordAction( - content::UserMetricsAction("ClickedBookmarkBarAppsShortcutButton")); + base::UserMetricsAction("ClickedBookmarkBarAppsShortcutButton")); } } diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index df92315..c5a6f24 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -332,7 +332,7 @@ void AddIfNotBookmarked(BookmarkModel* model, if (!bookmarks.empty()) return; // Nothing to do, a bookmark with that url already exists. - content::RecordAction(content::UserMetricsAction("BookmarkAdded")); + content::RecordAction(base::UserMetricsAction("BookmarkAdded")); const BookmarkNode* parent = model->GetParentForNewNodes(); model->AddURL(parent, parent->child_count(), title, url); } diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc index b0511ee..870696d 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc @@ -82,10 +82,10 @@ #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/common/quota/quota_types.h" +using base::UserMetricsAction; using content::BrowserContext; using content::BrowserThread; using content::DOMStorageContext; -using content::UserMetricsAction; bool BrowsingDataRemover::is_removing_ = false; diff --git a/chrome/browser/chrome_page_zoom.cc b/chrome/browser/chrome_page_zoom.cc index 8fb9cf9..5c6c7c3 100644 --- a/chrome/browser/chrome_page_zoom.cc +++ b/chrome/browser/chrome_page_zoom.cc @@ -17,7 +17,7 @@ #include "content/public/common/page_zoom.h" #include "content/public/common/renderer_preferences.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace chrome_page_zoom { diff --git a/chrome/browser/chromeos/attestation/platform_verification_flow.cc b/chrome/browser/chromeos/attestation/platform_verification_flow.cc index 132e1a7..d43f1e2 100644 --- a/chrome/browser/chromeos/attestation/platform_verification_flow.cc +++ b/chrome/browser/chromeos/attestation/platform_verification_flow.cc @@ -239,12 +239,12 @@ void PlatformVerificationFlow::OnConsentResponse( } if (consent_response == CONSENT_RESPONSE_DENY) { content::RecordAction( - content::UserMetricsAction("PlatformVerificationRejected")); + base::UserMetricsAction("PlatformVerificationRejected")); ReportError(context.callback, USER_REJECTED); return; } else if (consent_response == CONSENT_RESPONSE_ALLOW) { content::RecordAction( - content::UserMetricsAction("PlatformVerificationAccepted")); + base::UserMetricsAction("PlatformVerificationAccepted")); } } diff --git a/chrome/browser/chromeos/charger_replace/charger_replacement_dialog.cc b/chrome/browser/chromeos/charger_replace/charger_replacement_dialog.cc index 9d1bfe8..d255085 100644 --- a/chrome/browser/chromeos/charger_replace/charger_replacement_dialog.cc +++ b/chrome/browser/chromeos/charger_replace/charger_replacement_dialog.cc @@ -70,7 +70,7 @@ void ChargerReplacementDialog::SetFocusOnChargerDialogIfVisible() { void ChargerReplacementDialog::Show() { content::RecordAction( - content::UserMetricsAction("ShowChargerReplacementDialog")); + base::UserMetricsAction("ShowChargerReplacementDialog")); is_window_visible_ = true; // We show the dialog for the active user, so that the dialog will get diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc index c1e0415..27b90ee 100644 --- a/chrome/browser/chromeos/external_metrics.cc +++ b/chrome/browser/chromeos/external_metrics.cc @@ -32,8 +32,8 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/user_metrics.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace chromeos { diff --git a/chrome/browser/chromeos/file_manager/open_util.cc b/chrome/browser/chromeos/file_manager/open_util.cc index 86952cb..279186c 100644 --- a/chrome/browser/chromeos/file_manager/open_util.cc +++ b/chrome/browser/chromeos/file_manager/open_util.cc @@ -38,9 +38,9 @@ #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/file_system_url.h" +using base::UserMetricsAction; using content::BrowserContext; using content::BrowserThread; -using content::UserMetricsAction; using extensions::Extension; using extensions::app_file_handler_util::FindFileHandlersForFiles; using extensions::app_file_handler_util::PathAndMimeTypeSet; diff --git a/chrome/browser/chromeos/locale_change_guard.cc b/chrome/browser/chromeos/locale_change_guard.cc index 034ce49..32e58dc 100644 --- a/chrome/browser/chromeos/locale_change_guard.cc +++ b/chrome/browser/chromeos/locale_change_guard.cc @@ -29,7 +29,7 @@ #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; namespace chromeos { diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 5cd162c..013756a 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc @@ -303,7 +303,7 @@ void ExistingUserController::CancelPasswordChangedFlow() { } void ExistingUserController::CreateAccount() { - content::RecordAction(content::UserMetricsAction("Login.CreateAccount")); + content::RecordAction(base::UserMetricsAction("Login.CreateAccount")); guest_mode_url_ = google_util::AppendGoogleLocaleParam(GURL(kCreateAccountURL)); LoginAsGuest(); diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc index 0604adf9..4866d9e 100644 --- a/chrome/browser/chromeos/login/login_performer.cc +++ b/chrome/browser/chromeos/login/login_performer.cc @@ -42,8 +42,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace chromeos { diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc index 1fa75b6..c88738b 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc @@ -286,7 +286,7 @@ void LocallyManagedUserCreationController::OnManagedUserFilesStored( timeout_timer_.Stop(); content::RecordAction( - content::UserMetricsAction("ManagedMode_LocallyManagedUserCreated")); + base::UserMetricsAction("ManagedMode_LocallyManagedUserCreated")); if (!success) { if (consumer_) diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 33a0ee3..1c086b4 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -54,8 +54,8 @@ #include "ui/gfx/image/image.h" #include "url/gurl.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/content_settings/content_settings_default_provider.cc b/chrome/browser/content_settings/content_settings_default_provider.cc index 405f3b3..ddce1df 100644 --- a/chrome/browser/content_settings/content_settings_default_provider.cc +++ b/chrome/browser/content_settings/content_settings_default_provider.cc @@ -26,8 +26,8 @@ #include "content/public/browser/user_metrics.h" #include "url/gurl.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc index 20b6453..4e46cca 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc @@ -29,8 +29,8 @@ #include "content/public/browser/user_metrics.h" #include "url/gurl.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc index 529df81..95ba005 100644 --- a/chrome/browser/content_settings/cookie_settings.cc +++ b/chrome/browser/content_settings/cookie_settings.cc @@ -26,8 +26,8 @@ #include "net/base/static_cookie_policy.h" #include "url/gurl.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 90f1340..e19ecd7 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -39,8 +39,8 @@ #include "net/base/static_cookie_policy.h" #include "url/gurl.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc index 4864aa3..6160b6e 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc +++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc @@ -20,7 +20,7 @@ void RegisterProtocolHandlerInfoBarDelegate::Create( ProtocolHandlerRegistry* registry, const ProtocolHandler& handler) { content::RecordAction( - content::UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown")); + base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown")); scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar( scoped_ptr<ConfirmInfoBarDelegate>( @@ -95,14 +95,14 @@ bool RegisterProtocolHandlerInfoBarDelegate::NeedElevation( bool RegisterProtocolHandlerInfoBarDelegate::Accept() { content::RecordAction( - content::UserMetricsAction("RegisterProtocolHandler.Infobar_Accept")); + base::UserMetricsAction("RegisterProtocolHandler.Infobar_Accept")); registry_->OnAcceptRegisterProtocolHandler(handler_); return true; } bool RegisterProtocolHandlerInfoBarDelegate::Cancel() { content::RecordAction( - content::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny")); + base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny")); registry_->OnIgnoreRegisterProtocolHandler(handler_); return true; } @@ -114,7 +114,7 @@ base::string16 RegisterProtocolHandlerInfoBarDelegate::GetLinkText() const { bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked( WindowOpenDisposition disposition) { content::RecordAction( - content::UserMetricsAction("RegisterProtocolHandler.InfoBar_LearnMore")); + base::UserMetricsAction("RegisterProtocolHandler.InfoBar_LearnMore")); web_contents()->OpenURL(content::OpenURLParams( GURL(chrome::kLearnMoreRegisterProtocolHandlerURL), content::Referrer(), (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, diff --git a/chrome/browser/devtools/devtools_adb_bridge.cc b/chrome/browser/devtools/devtools_adb_bridge.cc index 25e6013..c632877 100644 --- a/chrome/browser/devtools/devtools_adb_bridge.cc +++ b/chrome/browser/devtools/devtools_adb_bridge.cc @@ -802,10 +802,10 @@ class AgentHostDelegate : public content::DevToolsExternalAgentProxyDelegate, if (socket_name.find(kWebViewSocketPrefix) == 0) { content::RecordAction( - content::UserMetricsAction("DevTools_InspectAndroidWebView")); + base::UserMetricsAction("DevTools_InspectAndroidWebView")); } else { content::RecordAction( - content::UserMetricsAction("DevTools_InspectAndroidPage")); + base::UserMetricsAction("DevTools_InspectAndroidPage")); } } diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index df79fcf..a055ca6 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc @@ -369,7 +369,7 @@ DevToolsWindow* DevToolsWindow::OpenDevToolsWindowForWorker( // static DevToolsWindow* DevToolsWindow::CreateDevToolsWindowForWorker( Profile* profile) { - content::RecordAction(content::UserMetricsAction("DevTools_InspectWorker")); + content::RecordAction(base::UserMetricsAction("DevTools_InspectWorker")); return Create(profile, GURL(), NULL, DEVTOOLS_DOCK_SIDE_UNDOCKED, true, false, false); } @@ -426,7 +426,7 @@ DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow( inspected_rvh->GetProcess()->GetBrowserContext()); DevToolsDockSide dock_side = GetDockSideFromPrefs(profile); content::RecordAction( - content::UserMetricsAction("DevTools_InspectRenderer")); + base::UserMetricsAction("DevTools_InspectRenderer")); window = Create(profile, GURL(), inspected_rvh, dock_side, false, false, true); manager->RegisterDevToolsClientHostFor(agent.get(), diff --git a/chrome/browser/extensions/api/input/input.cc b/chrome/browser/extensions/api/input/input.cc index f7a2e8f..f91af6c 100644 --- a/chrome/browser/extensions/api/input/input.cc +++ b/chrome/browser/extensions/api/input/input.cc @@ -133,7 +133,7 @@ bool VirtualKeyboardPrivateKeyboardLoadedFunction::RunImpl() { #if defined(USE_ASH) keyboard::MarkKeyboardLoadFinished(); - content::UserMetricsAction("VirtualKeyboardLoaded"); + base::UserMetricsAction("VirtualKeyboardLoaded"); return true; #endif diff --git a/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc b/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc index f87f7dd..86eb577 100644 --- a/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc +++ b/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc @@ -7,9 +7,9 @@ #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" #include "base/metrics/statistics_recorder.h" +#include "base/metrics/user_metrics.h" #include "chrome/browser/extensions/extension_apitest.h" #include "components/variations/variations_associated_data.h" -#include "content/public/browser/user_metrics.h" namespace { @@ -70,7 +70,7 @@ class UserActionObserver { UserActionCountMap count_map_; - content::ActionCallback action_callback_; + base::ActionCallback action_callback_; DISALLOW_COPY_AND_ASSIGN(UserActionObserver); }; @@ -78,11 +78,11 @@ class UserActionObserver { UserActionObserver::UserActionObserver() : action_callback_(base::Bind(&UserActionObserver::OnUserAction, base::Unretained(this))) { - content::AddActionCallback(action_callback_); + base::AddActionCallback(action_callback_); } UserActionObserver::~UserActionObserver() { - content::RemoveActionCallback(action_callback_); + base::RemoveActionCallback(action_callback_); } void UserActionObserver::OnUserAction(const std::string& action) { diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index e3f4f55..cf2927e 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -1251,8 +1251,10 @@ bool ExtensionWebRequestEventRouter::AddEventListener( listener.ipc_sender = ipc_sender; listener.embedder_process_id = embedder_process_id; listener.webview_instance_id = webview_instance_id; - if (listener.webview_instance_id) - RecordAction(content::UserMetricsAction("WebView.WebRequest.AddListener")); + if (listener.webview_instance_id) { + content::RecordAction( + base::UserMetricsAction("WebView.WebRequest.AddListener")); + } if (listeners_[profile][event_name].count(listener) != 0u) { // This is likely an abuse of the API by a malicious extension. diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index e5d5e50..e3ba248 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -61,8 +61,8 @@ #include "chrome/browser/chromeos/login/user_manager.h" #endif +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; using extensions::SharedModuleInfo; namespace extensions { diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc index 22a0ae6..f506d1a 100644 --- a/chrome/browser/extensions/extension_function_dispatcher.cc +++ b/chrome/browser/extensions/extension_function_dispatcher.cc @@ -89,7 +89,7 @@ base::LazyInstance<Static> g_global_io_data = LAZY_INSTANCE_INITIALIZER; // Kills the specified process because it sends us a malformed message. void KillBadMessageSender(base::ProcessHandle process) { NOTREACHED(); - content::RecordAction(content::UserMetricsAction("BadMessageTerminate_EFD")); + content::RecordAction(base::UserMetricsAction("BadMessageTerminate_EFD")); if (process) base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, false); } diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc index 2808367..66bbf6f 100644 --- a/chrome/browser/extensions/installed_loader.cc +++ b/chrome/browser/extensions/installed_loader.cc @@ -31,8 +31,8 @@ #include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_handlers/background_info.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace extensions { diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 6801c31..add798e 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -62,7 +62,7 @@ #include "google_apis/gaia/gaia_auth_util.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/browser/gpu/gpu_mode_manager.cc b/chrome/browser/gpu/gpu_mode_manager.cc index bb18baf..8bd33ec6 100644 --- a/chrome/browser/gpu/gpu_mode_manager.cc +++ b/chrome/browser/gpu/gpu_mode_manager.cc @@ -13,7 +13,7 @@ #include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/user_metrics.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/browser/guestview/webview/plugin_permission_helper.cc b/chrome/browser/guestview/webview/plugin_permission_helper.cc index 4366610..e5c3482 100644 --- a/chrome/browser/guestview/webview/plugin_permission_helper.cc +++ b/chrome/browser/guestview/webview/plugin_permission_helper.cc @@ -71,7 +71,7 @@ void PluginPermissionHelper::OnBlockedUnauthorizedPlugin( identifier), true /* allowed_by_default */); content::RecordAction( - content::UserMetricsAction("WebView.Guest.PluginLoadRequest")); + base::UserMetricsAction("WebView.Guest.PluginLoadRequest")); } void PluginPermissionHelper::OnCouldNotLoadPlugin( diff --git a/chrome/browser/guestview/webview/webview_guest.cc b/chrome/browser/guestview/webview/webview_guest.cc index 01be30e..d31127c 100644 --- a/chrome/browser/guestview/webview/webview_guest.cc +++ b/chrome/browser/guestview/webview/webview_guest.cc @@ -36,8 +36,8 @@ #include "chrome/browser/guestview/webview/plugin_permission_helper.h" #endif +using base::UserMetricsAction; using content::WebContents; -using content::UserMetricsAction; namespace { @@ -159,27 +159,27 @@ void WebViewGuest::RecordUserInitiatedUMA(const PermissionResponseInfo& info, // have geolocation access on its own. switch (info.permission_type) { case BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionAllow.Download")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_GEOLOCATION: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionAllow.Geolocation")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_MEDIA: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionAllow.Media")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_POINTER_LOCK: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionAllow.PointerLock")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_NEW_WINDOW: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionAllow.NewWindow")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_JAVASCRIPT_DIALOG: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionAllow.JSDialog")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_UNKNOWN: @@ -189,7 +189,7 @@ void WebViewGuest::RecordUserInitiatedUMA(const PermissionResponseInfo& info, static_cast<WebViewPermissionType>(info.permission_type); switch (webview_permission_type) { case WEB_VIEW_PERMISSION_TYPE_LOAD_PLUGIN: - RecordAction( + content::RecordAction( UserMetricsAction("WebView.Guest.PermissionAllow.PluginLoad")); break; default: @@ -200,27 +200,27 @@ void WebViewGuest::RecordUserInitiatedUMA(const PermissionResponseInfo& info, } else { switch (info.permission_type) { case BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionDeny.Download")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_GEOLOCATION: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionDeny.Geolocation")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_MEDIA: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionDeny.Media")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_POINTER_LOCK: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionDeny.PointerLock")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_NEW_WINDOW: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionDeny.NewWindow")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_JAVASCRIPT_DIALOG: - RecordAction( + content::RecordAction( UserMetricsAction("BrowserPlugin.PermissionDeny.JSDialog")); break; case BROWSER_PLUGIN_PERMISSION_TYPE_UNKNOWN: @@ -230,7 +230,7 @@ void WebViewGuest::RecordUserInitiatedUMA(const PermissionResponseInfo& info, static_cast<WebViewPermissionType>(info.permission_type); switch (webview_permission_type) { case WEB_VIEW_PERMISSION_TYPE_LOAD_PLUGIN: - RecordAction( + content::RecordAction( UserMetricsAction("WebView.Guest.PermissionDeny.PluginLoad")); break; default: diff --git a/chrome/browser/managed_mode/managed_user_settings_service.cc b/chrome/browser/managed_mode/managed_user_settings_service.cc index 9b24e97..bc9520f 100644 --- a/chrome/browser/managed_mode/managed_user_settings_service.cc +++ b/chrome/browser/managed_mode/managed_user_settings_service.cc @@ -21,9 +21,9 @@ using base::DictionaryValue; using base::JSONReader; +using base::UserMetricsAction; using base::Value; using content::BrowserThread; -using content::UserMetricsAction; using syncer::MANAGED_USER_SETTINGS; using syncer::ModelType; using syncer::SyncChange; diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 64ea202..b96af84 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -653,10 +653,10 @@ void MetricsService::EnableRecording() { OpenNewLog(); SetUpNotifications(®istrar_, this); - content::RemoveActionCallback(action_callback_); + base::RemoveActionCallback(action_callback_); action_callback_ = base::Bind(&MetricsService::OnUserAction, base::Unretained(this)); - content::AddActionCallback(action_callback_); + base::AddActionCallback(action_callback_); } void MetricsService::DisableRecording() { @@ -666,7 +666,7 @@ void MetricsService::DisableRecording() { return; recording_active_ = false; - content::RemoveActionCallback(action_callback_); + base::RemoveActionCallback(action_callback_); registrar_.RemoveAll(); PushPendingLogsToPersistentStorage(); DCHECK(!log_manager_.has_staged_log()); @@ -1749,7 +1749,7 @@ void MetricsService::IncrementLongPrefsValue(const char* path) { } void MetricsService::LogLoadStarted(content::WebContents* web_contents) { - content::RecordAction(content::UserMetricsAction("PageLoad")); + content::RecordAction(base::UserMetricsAction("PageLoad")); HISTOGRAM_ENUMERATION("Chrome.UmaPageloadCounter", 1, 2); IncrementPrefValue(prefs::kStabilityPageLoadCount); IncrementLongPrefsValue(prefs::kUninstallMetricsPageLoadCount); diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h index 2c5ea8a..dadbf59 100644 --- a/chrome/browser/metrics/metrics_service.h +++ b/chrome/browser/metrics/metrics_service.h @@ -17,6 +17,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/metrics/field_trial.h" +#include "base/metrics/user_metrics.h" #include "base/process/kill.h" #include "base/time/time.h" #include "chrome/browser/metrics/metrics_log.h" @@ -474,7 +475,7 @@ class MetricsService void GetCurrentSyntheticFieldTrials( std::vector<chrome_variations::ActiveGroupId>* synthetic_trials); - content::ActionCallback action_callback_; + base::ActionCallback action_callback_; content::NotificationRegistrar registrar_; diff --git a/chrome/browser/notifications/message_center_stats_collector.cc b/chrome/browser/notifications/message_center_stats_collector.cc index 3279728..3ab6203 100644 --- a/chrome/browser/notifications/message_center_stats_collector.cc +++ b/chrome/browser/notifications/message_center_stats_collector.cc @@ -124,11 +124,11 @@ void MessageCenterStatsCollector::OnCenterVisibilityChanged( break; case message_center::VISIBILITY_MESSAGE_CENTER: content::RecordAction( - content::UserMetricsAction("Notifications.ShowMessageCenter")); + base::UserMetricsAction("Notifications.ShowMessageCenter")); break; case message_center::VISIBILITY_SETTINGS: content::RecordAction( - content::UserMetricsAction("Notifications.ShowSettings")); + base::UserMetricsAction("Notifications.ShowSettings")); break; } } @@ -136,10 +136,10 @@ void MessageCenterStatsCollector::OnCenterVisibilityChanged( void MessageCenterStatsCollector::OnQuietModeChanged(bool in_quiet_mode) { if (in_quiet_mode) { content::RecordAction( - content::UserMetricsAction("Notifications.Mute")); + base::UserMetricsAction("Notifications.Mute")); } else { content::RecordAction( - content::UserMetricsAction("Notifications.Unmute")); + base::UserMetricsAction("Notifications.Unmute")); } } diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc index 3118a9e..c976190 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.cc @@ -38,7 +38,7 @@ #include "ui/message_center/notifier_settings.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace notifier { diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc index f1a6347..eb6adfc 100644 --- a/chrome/browser/password_manager/password_manager.cc +++ b/chrome/browser/password_manager/password_manager.cc @@ -32,8 +32,8 @@ using autofill::PasswordForm; using autofill::PasswordFormMap; +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; using content::WebContents; DEFINE_WEB_CONTENTS_USER_DATA_KEY(PasswordManager); diff --git a/chrome/browser/pepper_broker_infobar_delegate.cc b/chrome/browser/pepper_broker_infobar_delegate.cc index 0b9552c..fa1824b 100644 --- a/chrome/browser/pepper_broker_infobar_delegate.cc +++ b/chrome/browser/pepper_broker_infobar_delegate.cc @@ -78,7 +78,7 @@ void PepperBrokerInfoBarDelegate::Create( if (setting == CONTENT_SETTING_ASK) { content::RecordAction( - content::UserMetricsAction("PPAPI.BrokerInfobarDisplayed")); + base::UserMetricsAction("PPAPI.BrokerInfobarDisplayed")); InfoBarService* infobar_service = InfoBarService::FromWebContents(web_contents); infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( @@ -91,8 +91,8 @@ void PepperBrokerInfoBarDelegate::Create( bool allowed = (setting == CONTENT_SETTING_ALLOW); content::RecordAction(allowed ? - content::UserMetricsAction("PPAPI.BrokerSettingAllow") : - content::UserMetricsAction("PPAPI.BrokerSettingDeny")); + base::UserMetricsAction("PPAPI.BrokerSettingAllow") : + base::UserMetricsAction("PPAPI.BrokerSettingDeny")); tab_content_settings->SetPepperBrokerAllowed(allowed); callback.Run(allowed); } @@ -168,8 +168,8 @@ bool PepperBrokerInfoBarDelegate::LinkClicked( void PepperBrokerInfoBarDelegate::DispatchCallback(bool result) { content::RecordAction(result ? - content::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") : - content::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); + base::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") : + base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); callback_.Run(result); callback_ = base::Callback<void(bool)>(); content_settings_->SetContentSetting( diff --git a/chrome/browser/plugins/plugin_infobar_delegates.cc b/chrome/browser/plugins/plugin_infobar_delegates.cc index e4933fa..2c46ad2 100644 --- a/chrome/browser/plugins/plugin_infobar_delegates.cc +++ b/chrome/browser/plugins/plugin_infobar_delegates.cc @@ -44,7 +44,7 @@ #endif #endif -using content::UserMetricsAction; +using base::UserMetricsAction; // PluginInfoBarDelegate ------------------------------------------------------ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 3ef5fb6..c7275d1 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -139,10 +139,10 @@ using base::Time; using base::TimeDelta; +using base::UserMetricsAction; using content::BrowserThread; using content::DownloadManagerDelegate; using content::HostZoomMap; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index b1ce3f7..711740c 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc @@ -82,8 +82,8 @@ #include "chromeos/dbus/dbus_thread_manager.h" #endif +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/profiles/profile_metrics.cc b/chrome/browser/profiles/profile_metrics.cc index 16c3ce1..bd4ac3b2 100644 --- a/chrome/browser/profiles/profile_metrics.cc +++ b/chrome/browser/profiles/profile_metrics.cc @@ -276,7 +276,7 @@ void ProfileMetrics::LogProfileLaunch(Profile* profile) { if (profile->IsManaged()) { content::RecordAction( - content::UserMetricsAction("ManagedMode_NewManagedUserWindow")); + base::UserMetricsAction("ManagedMode_NewManagedUserWindow")); } } diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc index 9cdcf4d..821239c 100644 --- a/chrome/browser/profiles/profile_window.cc +++ b/chrome/browser/profiles/profile_window.cc @@ -22,8 +22,8 @@ #include "chrome/browser/ui/startup/startup_browser_creator.h" #endif // !defined (OS_IOS) +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index ed6c951..cd433b6 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -45,11 +45,11 @@ #include "ui/base/webui/jstemplate_builder.h" #include "ui/base/webui/web_ui_util.h" +using base::UserMetricsAction; using content::BrowserThread; using content::InterstitialPage; using content::OpenURLParams; using content::Referrer; -using content::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/search/most_visited_iframe_source.cc b/chrome/browser/search/most_visited_iframe_source.cc index 94481f5..de00f0c 100644 --- a/chrome/browser/search/most_visited_iframe_source.cc +++ b/chrome/browser/search/most_visited_iframe_source.cc @@ -82,7 +82,7 @@ void MostVisitedIframeSource::StartDataRequest( // Records the action. This will be available as a time-stamped stream // server-side and can be used to compute time-to-long-dwell. - content::RecordAction(content::UserMetricsAction("MostVisited_Clicked")); + content::RecordAction(base::UserMetricsAction("MostVisited_Clicked")); } callback.Run(NULL); } else { diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 5ba64b2..98787bf 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -107,6 +107,7 @@ #endif // defined(ENABLE_FULL_PRINTING) #endif // defined(ENABLE_PRINTING) +using base::UserMetricsAction; using blink::WebContextMenuData; using blink::WebMediaPlayerAction; using blink::WebPluginAction; @@ -121,7 +122,6 @@ using content::NavigationEntry; using content::OpenURLParams; using content::RenderViewHost; using content::SSLStatus; -using content::UserMetricsAction; using content::WebContents; using extensions::Extension; using extensions::MenuItem; diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index 24a40da..e5ef54d 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc @@ -36,8 +36,8 @@ #include "ui/base/win/shell.h" #endif +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; using extensions::Extension; using extensions::UnloadedExtensionInfo; using ui::ResourceBundle; diff --git a/chrome/browser/ui/app_list/extension_app_item.cc b/chrome/browser/ui/app_list/extension_app_item.cc index 118aba9..e0bff9d 100644 --- a/chrome/browser/ui/app_list/extension_app_item.cc +++ b/chrome/browser/ui/app_list/extension_app_item.cc @@ -256,7 +256,7 @@ void ExtensionAppItem::Activate(int event_flags) { if (RunExtensionEnableFlow()) return; - content::RecordAction(content::UserMetricsAction("AppList_ClickOnApp")); + content::RecordAction(base::UserMetricsAction("AppList_ClickOnApp")); CoreAppLauncherHandler::RecordAppListMainLaunch(extension); GetController()->ActivateApp(profile_, extension, diff --git a/chrome/browser/ui/app_list/search/app_result.cc b/chrome/browser/ui/app_list/search/app_result.cc index c66e6aa..c8f22ca 100644 --- a/chrome/browser/ui/app_list/search/app_result.cc +++ b/chrome/browser/ui/app_list/search/app_result.cc @@ -83,7 +83,7 @@ void AppResult::Open(int event_flags) { CoreAppLauncherHandler::RecordAppListSearchLaunch(extension); content::RecordAction( - content::UserMetricsAction("AppList_ClickOnAppFromSearch")); + base::UserMetricsAction("AppList_ClickOnAppFromSearch")); controller_->ActivateApp( profile_, diff --git a/chrome/browser/ui/app_list/search/people/people_result.cc b/chrome/browser/ui/app_list/search/people/people_result.cc index 5c0c977..7de9608 100644 --- a/chrome/browser/ui/app_list/search/people/people_result.cc +++ b/chrome/browser/ui/app_list/search/people/people_result.cc @@ -166,7 +166,7 @@ void PeopleResult::OpenChat() { profile_)->event_router()->DispatchEventToExtension( hangouts_extension_id_, event.Pass()); - content::RecordAction(content::UserMetricsAction("PeopleSearch_OpenChat")); + content::RecordAction(base::UserMetricsAction("PeopleSearch_OpenChat")); } void PeopleResult::SendEmail() { @@ -176,7 +176,7 @@ void PeopleResult::SendEmail() { // If no window exists, this will open a new window this one tab. params.disposition = NEW_FOREGROUND_TAB; chrome::Navigate(¶ms); - content::RecordAction(content::UserMetricsAction("PeopleSearch_SendEmail")); + content::RecordAction(base::UserMetricsAction("PeopleSearch_SendEmail")); } void PeopleResult::RefreshHangoutsExtensionId() { diff --git a/chrome/browser/ui/app_list/search/search_controller.cc b/chrome/browser/ui/app_list/search/search_controller.cc index d2f3fe4..90c2be2 100644 --- a/chrome/browser/ui/app_list/search/search_controller.cc +++ b/chrome/browser/ui/app_list/search/search_controller.cc @@ -118,7 +118,7 @@ void SearchController::Stop() { void SearchController::OpenResult(SearchResult* result, int event_flags) { // Count AppList.Search here because it is composed of search + action. - content::RecordAction(content::UserMetricsAction("AppList_Search")); + content::RecordAction(base::UserMetricsAction("AppList_Search")); ChromeSearchResult* chrome_result = static_cast<app_list::ChromeSearchResult*>(result); diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc index 8fdfe73..4353f1f 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc @@ -210,7 +210,7 @@ void ChromeShellDelegate::PreInit() { } void ChromeShellDelegate::Shutdown() { - content::RecordAction(content::UserMetricsAction("Shutdown")); + content::RecordAction(base::UserMetricsAction("Shutdown")); chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> RequestShutdown(); } diff --git a/chrome/browser/ui/ash/screenshot_taker.cc b/chrome/browser/ui/ash/screenshot_taker.cc index 5ea4276..28f5012 100644 --- a/chrome/browser/ui/ash/screenshot_taker.cc +++ b/chrome/browser/ui/ash/screenshot_taker.cc @@ -84,7 +84,7 @@ void CopyScreenshotToClipboard(scoped_refptr<base::RefCountedString> png_data) { html += kImageClipboardFormatSuffix; scw.WriteHTML(base::UTF8ToUTF16(html), std::string()); } - content::RecordAction(content::UserMetricsAction("Screenshot_CopyClipboard")); + content::RecordAction(base::UserMetricsAction("Screenshot_CopyClipboard")); } void ReadFileAndCopyToClipboardLocal(const base::FilePath& screenshot_path) { @@ -451,7 +451,7 @@ void ScreenshotTaker::HandleTakeScreenshotForAllRootWindows() { screenshot_path); } } - content::RecordAction(content::UserMetricsAction("Screenshot_TakeFull")); + content::RecordAction(base::UserMetricsAction("Screenshot_TakeFull")); last_screenshot_timestamp_ = base::Time::Now(); } @@ -493,7 +493,7 @@ void ScreenshotTaker::HandleTakePartialScreenshot( ScreenshotTakerObserver::SCREENSHOT_GRABWINDOW_PARTIAL_FAILED, screenshot_path); } - content::RecordAction(content::UserMetricsAction("Screenshot_TakePartial")); + content::RecordAction(base::UserMetricsAction("Screenshot_TakePartial")); } bool ScreenshotTaker::CanTakeScreenshot() { diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc index 6fb9aa1..42367b0 100644 --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc @@ -232,7 +232,7 @@ void ShowNetworkSettingsPage(const std::string& service_path) { std::string page = chrome::kInternetOptionsSubPage; page += "?servicePath=" + net::EscapeUrlEncodedData(service_path, true); content::RecordAction( - content::UserMetricsAction("OpenInternetOptionsDialog")); + base::UserMetricsAction("OpenInternetOptionsDialog")); ShowSettingsSubPageForAppropriateBrowser( page, ProfileManager::GetPrimaryUserProfile()); @@ -421,7 +421,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, virtual void ChangeProfilePicture() OVERRIDE { content::RecordAction( - content::UserMetricsAction("OpenChangeProfilePictureDialog")); + base::UserMetricsAction("OpenChangeProfilePictureDialog")); ShowSettingsSubPageForAppropriateBrowser( chrome::kChangeProfilePictureSubPage, ProfileManager::GetActiveUserProfile()); @@ -483,7 +483,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, } virtual void ShowDateSettings() OVERRIDE { - content::RecordAction(content::UserMetricsAction("ShowDateOptions")); + content::RecordAction(base::UserMetricsAction("ShowDateOptions")); std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_DATETIME); // Everybody can change the time zone (even though it is a device setting). @@ -503,7 +503,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, } virtual void ShowDisplaySettings() OVERRIDE { - content::RecordAction(content::UserMetricsAction("ShowDisplayOptions")); + content::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); ShowSettingsSubPageForAppropriateBrowser( kDisplaySettingsSubPageName, ProfileManager::GetActiveUserProfile()); @@ -554,7 +554,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, virtual void ShowIMESettings() OVERRIDE { content::RecordAction( - content::UserMetricsAction("OpenLanguageOptionsDialog")); + base::UserMetricsAction("OpenLanguageOptionsDialog")); ShowSettingsSubPageForAppropriateBrowser( chrome::kLanguageOptionsSubPage, ProfileManager::GetActiveUserProfile()); @@ -575,7 +575,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, virtual void ShowAccessibilitySettings() OVERRIDE { content::RecordAction( - content::UserMetricsAction("ShowAccessibilitySettings")); + base::UserMetricsAction("ShowAccessibilitySettings")); std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + l10n_util::GetStringUTF8( IDS_OPTIONS_SETTINGS_SECTION_TITLE_ACCESSIBILITY); @@ -804,7 +804,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, virtual void ManageBluetoothDevices() OVERRIDE { content::RecordAction( - content::UserMetricsAction("ShowBluetoothSettingsPage")); + base::UserMetricsAction("ShowBluetoothSettingsPage")); std::string sub_page = std::string(chrome::kSearchSubPage) + "#" + l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_SECTION_TITLE_BLUETOOTH); ShowSettingsSubPageForAppropriateBrowser( diff --git a/chrome/browser/ui/ash/volume_controller_chromeos.cc b/chrome/browser/ui/ash/volume_controller_chromeos.cc index b8fdff3..f596301 100644 --- a/chrome/browser/ui/ash/volume_controller_chromeos.cc +++ b/chrome/browser/ui/ash/volume_controller_chromeos.cc @@ -29,7 +29,7 @@ VolumeController::~VolumeController() { bool VolumeController::HandleVolumeMute(const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_VOLUME_MUTE) - content::RecordAction(content::UserMetricsAction("Accel_VolumeMute_F8")); + content::RecordAction(base::UserMetricsAction("Accel_VolumeMute_F8")); CrasAudioHandler::Get()->SetOutputMute(true); return true; @@ -37,7 +37,7 @@ bool VolumeController::HandleVolumeMute(const ui::Accelerator& accelerator) { bool VolumeController::HandleVolumeDown(const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_VOLUME_DOWN) - content::RecordAction(content::UserMetricsAction("Accel_VolumeDown_F9")); + content::RecordAction(base::UserMetricsAction("Accel_VolumeDown_F9")); CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); if (audio_handler->IsOutputMuted()) { @@ -52,7 +52,7 @@ bool VolumeController::HandleVolumeDown(const ui::Accelerator& accelerator) { bool VolumeController::HandleVolumeUp(const ui::Accelerator& accelerator) { if (accelerator.key_code() == ui::VKEY_VOLUME_UP) - content::RecordAction(content::UserMetricsAction("Accel_VolumeUp_F10")); + content::RecordAction(base::UserMetricsAction("Accel_VolumeUp_F10")); CrasAudioHandler* audio_handler = CrasAudioHandler::Get(); if (audio_handler->IsOutputMuted()) { diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc index 5aeec168..9e038ef 100644 --- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc +++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc @@ -27,8 +27,8 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +using base::UserMetricsAction; using content::PageNavigator; -using content::UserMetricsAction; BookmarkContextMenuController::BookmarkContextMenuController( gfx::NativeWindow parent_window, diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc index 19e3626..dfcedf0 100644 --- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc +++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model.cc @@ -230,7 +230,7 @@ void RecentlyUsedFoldersComboModel::MaybeChangeParent( const BookmarkNode* new_parent = GetNodeAt(selected_index); if (new_parent != node->parent()) { content::RecordAction( - content::UserMetricsAction("BookmarkBubble_ChangeParent")); + base::UserMetricsAction("BookmarkBubble_ChangeParent")); bookmark_model_->Move(node, new_parent, new_parent->child_count()); } } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 0319aad..bf64958 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -208,6 +208,7 @@ #endif using base::TimeDelta; +using base::UserMetricsAction; using content::NativeWebKeyboardEvent; using content::NavigationController; using content::NavigationEntry; @@ -216,7 +217,6 @@ using content::PluginService; using content::Referrer; using content::RenderWidgetHostView; using content::SiteInstance; -using content::UserMetricsAction; using content::WebContents; using extensions::Extension; using ui::WebDialogDelegate; diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 6147c67..425f58d 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -395,23 +395,23 @@ void BrowserCommandController::ExecuteCommandWithDisposition( NewIncognitoWindow(browser_); break; case IDC_CLOSE_WINDOW: - content::RecordAction(content::UserMetricsAction("CloseWindowByKey")); + content::RecordAction(base::UserMetricsAction("CloseWindowByKey")); CloseWindow(browser_); break; case IDC_NEW_TAB: NewTab(browser_); break; case IDC_CLOSE_TAB: - content::RecordAction(content::UserMetricsAction("CloseTabByKey")); + content::RecordAction(base::UserMetricsAction("CloseTabByKey")); CloseTab(browser_); break; case IDC_SELECT_NEXT_TAB: - content::RecordAction(content::UserMetricsAction("Accel_SelectNextTab")); + content::RecordAction(base::UserMetricsAction("Accel_SelectNextTab")); SelectNextTab(browser_); break; case IDC_SELECT_PREVIOUS_TAB: content::RecordAction( - content::UserMetricsAction("Accel_SelectPreviousTab")); + base::UserMetricsAction("Accel_SelectPreviousTab")); SelectPreviousTab(browser_); break; case IDC_TABPOSE: @@ -459,7 +459,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( break; case IDC_MINIMIZE_WINDOW: content::RecordAction( - content::UserMetricsAction("Accel_Toggle_Minimized_M")); + base::UserMetricsAction("Accel_Toggle_Minimized_M")); ash::accelerators::ToggleMinimized(); break; // If Ash needs many more commands here we should implement a general @@ -496,7 +496,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( break; chrome::AttemptRestartToDesktopMode(); - content::RecordAction(content::UserMetricsAction("Win8DesktopRestart")); + content::RecordAction(base::UserMetricsAction("Win8DesktopRestart")); break; case IDC_WIN8_METRO_RESTART: if (!VerifyMetroSwitchForApps(window()->GetNativeWindow(), id)) @@ -504,7 +504,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( // SwitchToMetroUIHandler deletes itself. new SwitchToMetroUIHandler; - content::RecordAction(content::UserMetricsAction("Win8MetroRestart")); + content::RecordAction(base::UserMetricsAction("Win8MetroRestart")); break; #endif @@ -543,7 +543,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( Print(browser_); break; case IDC_ADVANCED_PRINT: - content::RecordAction(content::UserMetricsAction("Accel_Advanced_Print")); + content::RecordAction(base::UserMetricsAction("Accel_Advanced_Print")); AdvancedPrint(browser_); break; case IDC_PRINT_TO_DESTINATION: @@ -630,15 +630,15 @@ void BrowserCommandController::ExecuteCommandWithDisposition( // Focus various bits of UI case IDC_FOCUS_TOOLBAR: - content::RecordAction(content::UserMetricsAction("Accel_Focus_Toolbar")); + content::RecordAction(base::UserMetricsAction("Accel_Focus_Toolbar")); FocusToolbar(browser_); break; case IDC_FOCUS_LOCATION: - content::RecordAction(content::UserMetricsAction("Accel_Focus_Location")); + content::RecordAction(base::UserMetricsAction("Accel_Focus_Location")); FocusLocationBar(browser_); break; case IDC_FOCUS_SEARCH: - content::RecordAction(content::UserMetricsAction("Accel_Focus_Search")); + content::RecordAction(base::UserMetricsAction("Accel_Focus_Search")); FocusSearch(browser_); break; case IDC_FOCUS_MENU_BAR: @@ -646,7 +646,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( break; case IDC_FOCUS_BOOKMARKS: content::RecordAction( - content::UserMetricsAction("Accel_Focus_Bookmarks")); + base::UserMetricsAction("Accel_Focus_Bookmarks")); FocusBookmarksToolbar(browser_); break; case IDC_FOCUS_INFOBARS: @@ -708,7 +708,7 @@ void BrowserCommandController::ExecuteCommandWithDisposition( ShowBookmarkManager(browser_); break; case IDC_SHOW_APP_MENU: - content::RecordAction(content::UserMetricsAction("Accel_Show_App_Menu")); + content::RecordAction(base::UserMetricsAction("Accel_Show_App_Menu")); ShowAppMenu(browser_); break; case IDC_SHOW_AVATAR_MENU: diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 445bd49..50b77b2 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -94,12 +94,12 @@ namespace { const char kOsOverrideForTabletSite[] = "Linux; Android 4.0.3"; } +using base::UserMetricsAction; using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; using content::Referrer; using content::SSLStatus; -using content::UserMetricsAction; using content::WebContents; using web_modal::WebContentsModalDialogManager; diff --git a/chrome/browser/ui/browser_commands_chromeos.cc b/chrome/browser/ui/browser_commands_chromeos.cc index 6bc412e..c955b67 100644 --- a/chrome/browser/ui/browser_commands_chromeos.cc +++ b/chrome/browser/ui/browser_commands_chromeos.cc @@ -7,10 +7,10 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/screenshot_delegate.h" #include "ash/shell.h" +#include "base/metrics/user_metrics_action.h" #include "content/public/browser/user_metrics.h" -#include "content/public/common/user_metrics_action.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace chrome { diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc index 97862d2..aab91f7 100644 --- a/chrome/browser/ui/browser_instant_controller.cc +++ b/chrome/browser/ui/browser_instant_controller.cc @@ -28,7 +28,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index 66968ae..3ebc6f8 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc @@ -25,7 +25,7 @@ #include "chrome/browser/chromeos/login/user_manager.h" #endif -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; // static diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index be0c509..e810e2e 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc @@ -37,7 +37,7 @@ #include "chromeos/chromeos_switches.h" #endif -using content::UserMetricsAction; +using base::UserMetricsAction; namespace chrome { namespace { diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index 247cc03..55dc006 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -60,9 +60,9 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" +using base::UserMetricsAction; using content::OpenURLParams; using content::Referrer; -using content::UserMetricsAction; using content::WebContents; // Bookmark bar state changing and animations diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm index 867704b..3a62c85 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.mm @@ -11,7 +11,7 @@ #import "chrome/browser/ui/cocoa/browser_window_controller.h" #include "content/public/browser/user_metrics.h" -using content::UserMetricsAction; +using base::UserMetricsAction; #import "third_party/mozilla/NSPasteboard+Utils.h" diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm index 36df6f6..651f35d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm @@ -18,7 +18,7 @@ #include "content/public/browser/user_metrics.h" #import "third_party/mozilla/NSPasteboard+Utils.h" -using content::UserMetricsAction; +using base::UserMetricsAction; @interface BookmarkBarView (Private) - (void)themeDidChangeNotification:(NSNotification*)aNotification; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm index f46c89a..a801893 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm @@ -23,7 +23,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" -using content::UserMetricsAction; +using base::UserMetricsAction; // An object to represent the ChooseAnotherFolder item in the pop up. @interface ChooseAnotherFolder : NSObject diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm index 6a625c0..3974763 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm @@ -17,7 +17,7 @@ #include "content/public/browser/user_metrics.h" #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" -using content::UserMetricsAction; +using base::UserMetricsAction; // The opacity of the bookmark button drag image. static const CGFloat kDragImageOpacity = 0.7; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm index 3b5903b..cfaea93 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm @@ -15,7 +15,7 @@ #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" -using content::UserMetricsAction; +using base::UserMetricsAction; const int kHierarchyButtonXMargin = 4; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm index 67fb000..be12647 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm @@ -19,9 +19,9 @@ #import "ui/base/cocoa/cocoa_event_utils.h" #import "ui/base/cocoa/menu_controller.h" +using base::UserMetricsAction; using content::OpenURLParams; using content::Referrer; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm index b93ec91..59ed482 100644 --- a/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/importer/import_lock_dialog_cocoa.mm @@ -14,7 +14,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace importer { diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index 8be466b..76ae326 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -71,9 +71,9 @@ #include "ui/base/theme_provider.h" #include "ui/gfx/image/image.h" +using base::UserMetricsAction; using content::OpenURLParams; using content::Referrer; -using content::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm index d09f4d3..a7de40b 100644 --- a/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/website_settings_bubble_controller.mm @@ -506,7 +506,7 @@ NSColor* IdentityVerifiedTextColor() { - (void)showCookiesAndSiteData:(id)sender { DCHECK(webContents_); content::RecordAction( - content::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); + base::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); chrome::ShowCollectedCookiesDialog(webContents_); } diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm index 0e9033f..f7ffcac 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm @@ -34,8 +34,8 @@ namespace wrench_menu_controller { const CGFloat kWrenchBubblePointOffsetY = 6; } +using base::UserMetricsAction; using content::HostZoomMap; -using content::UserMetricsAction; @interface WrenchMenuController (Private) - (void)createModel; diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 9ec9944..3b58ae7 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc @@ -39,7 +39,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; using content_settings::SettingInfo; using content_settings::SettingSource; diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller.cc b/chrome/browser/ui/fullscreen/fullscreen_controller.cc index c84260c..3754c80 100644 --- a/chrome/browser/ui/fullscreen/fullscreen_controller.cc +++ b/chrome/browser/ui/fullscreen/fullscreen_controller.cc @@ -34,8 +34,8 @@ #include "chrome/common/pref_names.h" #endif +using base::UserMetricsAction; using content::RenderViewHost; -using content::UserMetricsAction; using content::WebContents; FullscreenController::FullscreenController(Browser* browser) diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc index f6b60da..6f65c60 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc @@ -64,8 +64,8 @@ #include "ui/gfx/image/cairo_cached_surface.h" #include "ui/gfx/image/image.h" +using base::UserMetricsAction; using content::PageNavigator; -using content::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc index 953e752..f561c59 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.cc @@ -36,7 +36,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/canvas_paint_gtk.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc index a56efe3..911523c 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc @@ -62,8 +62,8 @@ #include "ui/gfx/image/cairo_cached_surface.h" #include "ui/gfx/skbitmap_operations.h" +using base::UserMetricsAction; using content::HostZoomMap; -using content::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc index 5559b6c..b23fb4d 100644 --- a/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.cc @@ -16,7 +16,7 @@ #include "ui/base/gtk/gtk_hig_constants.h" #include "ui/base/l10n/l10n_util.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace importer { diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc index 886d8bf..6fb4e077 100644 --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc @@ -50,7 +50,7 @@ #include "ui/gfx/image/image.h" #include "ui/gfx/point.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc b/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc index 908b534..8c8e2ef 100644 --- a/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc +++ b/chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.cc @@ -711,7 +711,7 @@ gboolean WebsiteSettingsPopupGtk::OnTabstripExpose( void WebsiteSettingsPopupGtk::OnCookiesLinkClicked(GtkWidget* widget) { // Count how often the Collected Cookies dialog is opened. content::RecordAction( - content::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); + base::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); new CollectedCookiesGtk(GTK_WINDOW(parent_), web_contents_); bubble_->Close(); diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc index 0ddffb7..c01095b 100644 --- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc +++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc @@ -501,7 +501,7 @@ void OmniboxEditModel::SetInputInProgress(bool in_progress) { user_input_in_progress_ = in_progress; if (user_input_in_progress_) { time_user_first_modified_omnibox_ = base::TimeTicks::Now(); - content::RecordAction(content::UserMetricsAction("OmniboxInputInProgress")); + content::RecordAction(base::UserMetricsAction("OmniboxInputInProgress")); autocomplete_controller()->ResetSession(); // Once the user starts editing, re-enable URL replacement, so that it will // kick in if applicable once the edit is committed or reverted. (While the @@ -771,7 +771,7 @@ void OmniboxEditModel::OpenMatch(AutocompleteMatch match, return; } - content::RecordAction(content::UserMetricsAction("AcceptedKeyword")); + content::RecordAction(base::UserMetricsAction("AcceptedKeyword")); TemplateURLServiceFactory::GetForProfile(profile_)->IncrementUsageCount( template_url); } else { @@ -817,7 +817,7 @@ void OmniboxEditModel::OpenMatch(AutocompleteMatch match, if (TemplateURLServiceFactory::GetForProfile(profile_)-> IsSearchResultsPageFromDefaultSearchProvider(match.destination_url)) { content::RecordAction( - content::UserMetricsAction("OmniboxDestinationURLIsSearchOnDSP")); + base::UserMetricsAction("OmniboxDestinationURLIsSearchOnDSP")); } if (match.destination_url.is_valid()) { @@ -856,7 +856,7 @@ bool OmniboxEditModel::AcceptKeyword(EnteredKeywordModeMethod entered_method) { DisplayTextFromUserText(CurrentMatch(NULL).fill_into_edit), save_original_selection, true); - content::RecordAction(content::UserMetricsAction("AcceptedKeywordHint")); + content::RecordAction(base::UserMetricsAction("AcceptedKeywordHint")); UMA_HISTOGRAM_ENUMERATION(kEnteredKeywordModeHistogram, entered_method, ENTERED_KEYWORD_MODE_NUM_ITEMS); diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index bd495b7..f978d8c 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc @@ -40,8 +40,8 @@ #include "ui/gfx/image/image.h" #include "ui/gfx/rect.h" +using base::UserMetricsAction; using content::RenderViewHost; -using content::UserMetricsAction; namespace panel_internal { diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc index 73dd5a2..59be3ae 100644 --- a/chrome/browser/ui/panels/panel_host.cc +++ b/chrome/browser/ui/panels/panel_host.cc @@ -33,7 +33,7 @@ #include "ui/gfx/image/image.h" #include "ui/gfx/rect.h" -using content::UserMetricsAction; +using base::UserMetricsAction; PanelHost::PanelHost(Panel* panel, Profile* profile) : panel_(panel), diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc index 313f921..4971e7a 100644 --- a/chrome/browser/ui/passwords/password_manager_presenter.cc +++ b/chrome/browser/ui/passwords/password_manager_presenter.cc @@ -83,7 +83,7 @@ void PasswordManagerPresenter::RemoveSavedPassword(size_t index) { return; store->RemoveLogin(*password_list_[index]); content::RecordAction( - content::UserMetricsAction("PasswordManager_RemoveSavedPassword")); + base::UserMetricsAction("PasswordManager_RemoveSavedPassword")); } void PasswordManagerPresenter::RemovePasswordException(size_t index) { @@ -93,7 +93,7 @@ void PasswordManagerPresenter::RemovePasswordException(size_t index) { return; store->RemoveLogin(*password_exception_list_[index]); content::RecordAction( - content::UserMetricsAction("PasswordManager_RemovePasswordException")); + base::UserMetricsAction("PasswordManager_RemovePasswordException")); } void PasswordManagerPresenter::RequestShowPassword(size_t index) { diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc index b02b6cd..8249749 100644 --- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc +++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc @@ -45,11 +45,11 @@ #include "base/win/metro.h" #endif +using base::UserMetricsAction; using content::InterstitialPage; using content::OpenURLParams; using content::PluginService; using content::Referrer; -using content::UserMetricsAction; using content::WebContents; using content::WebPluginInfo; diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc index 68b6cef..e1deba0 100644 --- a/chrome/browser/ui/search/search_tab_helper.cc +++ b/chrome/browser/ui/search/search_tab_helper.cc @@ -475,7 +475,7 @@ void SearchTabHelper::NavigateToURL(const GURL& url, if (is_most_visited_item_url) { content::RecordAction( - content::UserMetricsAction("InstantExtended.MostVisitedClicked")); + base::UserMetricsAction("InstantExtended.MostVisitedClicked")); } chrome::NavigateParams params(browser, url, diff --git a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc index d220816..e608484 100644 --- a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc +++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc @@ -14,7 +14,7 @@ #include "content/public/browser/user_metrics.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; EditSearchEngineController::EditSearchEngineController( TemplateURL* template_url, diff --git a/chrome/browser/ui/search_engines/keyword_editor_controller.cc b/chrome/browser/ui/search_engines/keyword_editor_controller.cc index a5cfdf4..da40c17 100644 --- a/chrome/browser/ui/search_engines/keyword_editor_controller.cc +++ b/chrome/browser/ui/search_engines/keyword_editor_controller.cc @@ -14,7 +14,7 @@ #include "chrome/common/pref_names.h" #include "content/public/browser/user_metrics.h" -using content::UserMetricsAction; +using base::UserMetricsAction; KeywordEditorController::KeywordEditorController(Profile* profile) : profile_(profile) { diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc index ef7e828..e2c5349 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.cc +++ b/chrome/browser/ui/tabs/tab_strip_model.cc @@ -27,7 +27,7 @@ #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_view.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index 4f0b92b..e1648d9 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -32,9 +32,9 @@ #include "ui/gfx/favicon_size.h" #include "ui/gfx/text_elider.h" +using base::UserMetricsAction; using content::NavigationController; using content::NavigationEntry; -using content::UserMetricsAction; using content::WebContents; const int BackForwardMenuModel::kMaxHistoryItems = 12; diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 9a01398..99d7b96 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -72,8 +72,8 @@ #include "ash/shell.h" #endif +using base::UserMetricsAction; using content::HostZoomMap; -using content::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/uma_browsing_activity_observer.cc b/chrome/browser/ui/uma_browsing_activity_observer.cc index f0a53be..25cab82 100644 --- a/chrome/browser/ui/uma_browsing_activity_observer.cc +++ b/chrome/browser/ui/uma_browsing_activity_observer.cc @@ -57,7 +57,7 @@ void UMABrowsingActivityObserver::Observe( content::Source<content::NavigationController>(source).ptr(); // Track whether the page loaded is a search results page (SRP). Track // the non-SRP navigations as well so there is a control. - content::RecordAction(content::UserMetricsAction("NavEntryCommitted")); + content::RecordAction(base::UserMetricsAction("NavEntryCommitted")); // Attempting to determine the cause of a crash originating from // IsSearchResultsPageFromDefaultSearchProvider but manifesting in // TemplateURLRef::ExtractSearchTermsFromURL(...). @@ -67,8 +67,7 @@ void UMABrowsingActivityObserver::Observe( Profile::FromBrowserContext(controller->GetBrowserContext()))-> IsSearchResultsPageFromDefaultSearchProvider( load.entry->GetURL())) { - content::RecordAction( - content::UserMetricsAction("NavEntryCommitted.SRP")); + content::RecordAction(base::UserMetricsAction("NavEntryCommitted.SRP")); } if (!load.is_navigation_to_different_page()) diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index 18c4476..4142117 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -81,10 +81,10 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h" +using base::UserMetricsAction; using content::OpenURLParams; using content::PageNavigator; using content::Referrer; -using content::UserMetricsAction; using ui::DropTargetEvent; using views::CustomButton; using views::MenuButton; diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index 1bde9f6..fa8d8e5 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc @@ -33,7 +33,7 @@ #include "ui/views/layout/layout_constants.h" #include "ui/views/widget/widget.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using views::ColumnSet; using views::GridLayout; diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_win.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_win.cc index d251c72..5c1f8f9 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_win.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_win.cc @@ -17,9 +17,9 @@ #include "content/public/browser/web_contents.h" #include "win8/util/win8_util.h" +using base::UserMetricsAction; using content::OpenURLParams; using content::PageNavigator; -using content::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc index 6e64fcf..6b21763 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc @@ -24,8 +24,8 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/widget/widget.h" +using base::UserMetricsAction; using content::PageNavigator; -using content::UserMetricsAction; using views::MenuItemView; BookmarkMenuController::BookmarkMenuController(Browser* browser, diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc index 88a1b82..e7decf8a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc @@ -30,8 +30,8 @@ #include "ui/views/controls/menu/submenu_view.h" #include "ui/views/widget/widget.h" +using base::UserMetricsAction; using content::PageNavigator; -using content::UserMetricsAction; using views::MenuItemView; // Max width of a menu. There does not appear to be an OS value for this, yet diff --git a/chrome/browser/ui/views/conflicting_module_view_win.cc b/chrome/browser/ui/views/conflicting_module_view_win.cc index 0611709..21fbbf2 100644 --- a/chrome/browser/ui/views/conflicting_module_view_win.cc +++ b/chrome/browser/ui/views/conflicting_module_view_win.cc @@ -26,7 +26,7 @@ #include "ui/views/layout/layout_constants.h" #include "ui/views/widget/widget.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.cc b/chrome/browser/ui/views/critical_notification_bubble_view.cc index 7359b48c..fac0a28 100644 --- a/chrome/browser/ui/views/critical_notification_bubble_view.cc +++ b/chrome/browser/ui/views/critical_notification_bubble_view.cc @@ -27,7 +27,7 @@ #include "ui/views/layout/layout_constants.h" #include "ui/views/widget/widget.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index a1dc1b6..4207803 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -164,9 +164,9 @@ #endif using base::TimeDelta; +using base::UserMetricsAction; using content::NativeWebKeyboardEvent; using content::SSLStatus; -using content::UserMetricsAction; using content::WebContents; using views::ColumnSet; using views::GridLayout; diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc index 1b9f25e..2904444 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc @@ -17,7 +17,7 @@ #include "ui/views/layout/layout_constants.h" #include "ui/views/widget/widget.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace importer { diff --git a/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc b/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc index 52aecd3..a12266a 100644 --- a/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc +++ b/chrome/browser/ui/views/outdated_upgrade_bubble_view.cc @@ -60,7 +60,7 @@ void OutdatedUpgradeBubbleView::ShowBubble(views::View* anchor_view, views::BubbleDelegateView::CreateBubble(upgrade_bubble_); upgrade_bubble_->StartFade(true); content::RecordAction( - content::UserMetricsAction("OutdatedUpgradeBubble.Show")); + base::UserMetricsAction("OutdatedUpgradeBubble.Show")); } bool OutdatedUpgradeBubbleView::IsAvailable() { @@ -192,7 +192,7 @@ void OutdatedUpgradeBubbleView::HandleButtonPressed(views::Button* sender) { "OutdatedUpgradeBubble.NumLaterPerReinstall", num_ignored_bubbles_, 0, kMaxIgnored, kNumIgnoredBuckets); content::RecordAction( - content::UserMetricsAction("OutdatedUpgradeBubble.Reinstall")); + base::UserMetricsAction("OutdatedUpgradeBubble.Reinstall")); navigator_->OpenURL(content::OpenURLParams(GURL(kDownloadChromeUrl), content::Referrer(), NEW_FOREGROUND_TAB, @@ -201,7 +201,7 @@ void OutdatedUpgradeBubbleView::HandleButtonPressed(views::Button* sender) { } else { DCHECK_EQ(later_button_, sender); content::RecordAction( - content::UserMetricsAction("OutdatedUpgradeBubble.Later")); + base::UserMetricsAction("OutdatedUpgradeBubble.Later")); } StartFade(false); } diff --git a/chrome/browser/ui/views/profile_reset_bubble_view.cc b/chrome/browser/ui/views/profile_reset_bubble_view.cc index ccb23c3..1189356 100644 --- a/chrome/browser/ui/views/profile_reset_bubble_view.cc +++ b/chrome/browser/ui/views/profile_reset_bubble_view.cc @@ -158,7 +158,7 @@ ProfileResetBubbleView* ProfileResetBubbleView::ShowBubble( global_error, anchor_view, browser, browser->profile()); views::BubbleDelegateView::CreateBubble(reset_bubble); reset_bubble->StartFade(true); - content::RecordAction(content::UserMetricsAction("SettingsResetBubble.Show")); + content::RecordAction(base::UserMetricsAction("SettingsResetBubble.Show")); return reset_bubble; } @@ -382,7 +382,7 @@ void ProfileResetBubbleView::ButtonPressed(views::Button* sender, if (sender == controls_.reset_button) { DCHECK(!resetting_); content::RecordAction( - content::UserMetricsAction("SettingsResetBubble.Reset")); + base::UserMetricsAction("SettingsResetBubble.Reset")); // Remember that the user chose to reset, and that resetting is underway. chose_to_reset_ = true; @@ -400,7 +400,7 @@ void ProfileResetBubbleView::ButtonPressed(views::Button* sender, } else if (sender == controls_.no_thanks_button) { DCHECK(!resetting_); content::RecordAction( - content::UserMetricsAction("SettingsResetBubble.NoThanks")); + base::UserMetricsAction("SettingsResetBubble.NoThanks")); if (global_error_) global_error_->OnBubbleViewNoThanksButtonPressed(); @@ -416,7 +416,7 @@ void ProfileResetBubbleView::ButtonPressed(views::Button* sender, void ProfileResetBubbleView::LinkClicked(views::Link* source, int flags) { content::RecordAction( - content::UserMetricsAction("SettingsResetBubble.LearnMore")); + base::UserMetricsAction("SettingsResetBubble.LearnMore")); navigator_->OpenURL(content::OpenURLParams( GURL(chrome::kResetProfileSettingsLearnMoreURL), content::Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc index 0db3239..6661044 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -46,7 +46,7 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/widget/widget.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index ea403da..46d2621 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc @@ -64,8 +64,8 @@ #include "ui/events/gestures/gesture_recognizer.h" #endif +using base::UserMetricsAction; using content::OpenURLParams; -using content::UserMetricsAction; using content::WebContents; static const int kHorizontalMoveThreshold = 16; // Pixels. diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 42c1c65..f37295b 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -62,7 +62,7 @@ #include "win8/util/win8_util.h" #endif -using content::UserMetricsAction; +using base::UserMetricsAction; using ui::DropTargetEvent; namespace { diff --git a/chrome/browser/ui/views/toolbar/site_chip_view.cc b/chrome/browser/ui/views/toolbar/site_chip_view.cc index a9d5d43..b91c6b4 100644 --- a/chrome/browser/ui/views/toolbar/site_chip_view.cc +++ b/chrome/browser/ui/views/toolbar/site_chip_view.cc @@ -468,7 +468,7 @@ void SiteChipView::ButtonPressed(views::Button* sender, } UMA_HISTOGRAM_COUNTS("SiteChip.Pressed", 1); - content::RecordAction(content::UserMetricsAction("SiteChipPress")); + content::RecordAction(base::UserMetricsAction("SiteChipPress")); toolbar_view_->location_bar()->GetOmniboxView()->SetFocus(); toolbar_view_->location_bar()->GetOmniboxView()->model()-> diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index 1623abb..484beb2 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc @@ -83,7 +83,7 @@ #include "ui/native_theme/native_theme_aura.h" #endif -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; namespace { diff --git a/chrome/browser/ui/views/toolbar/wrench_menu.cc b/chrome/browser/ui/views/toolbar/wrench_menu.cc index ffcbd86..561cb63 100644 --- a/chrome/browser/ui/views/toolbar/wrench_menu.cc +++ b/chrome/browser/ui/views/toolbar/wrench_menu.cc @@ -61,8 +61,8 @@ #include "ui/native_theme/native_theme_aura.h" #endif +using base::UserMetricsAction; using content::HostZoomMap; -using content::UserMetricsAction; using content::WebContents; using ui::MenuModel; using views::CustomButton; diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc index 9cd17b4..10485fd 100644 --- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc +++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc @@ -755,7 +755,7 @@ void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) { if (source == cookie_dialog_link_) { // Count how often the Collected Cookies dialog is opened. content::RecordAction( - content::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); + base::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); new CollectedCookiesViews(web_contents_); } else if (source == certificate_dialog_link_) { gfx::NativeWindow parent = diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc index 7237507..9e56f72 100644 --- a/chrome/browser/ui/website_settings/website_settings.cc +++ b/chrome/browser/ui/website_settings/website_settings.cc @@ -162,7 +162,7 @@ WebsiteSettings::WebsiteSettings( // Every time the Website Settings UI is opened a |WebsiteSettings| object is // created. So this counts how ofter the Website Settings UI is opened. - content::RecordAction(content::UserMetricsAction("WebsiteSettings_Opened")); + content::RecordAction(base::UserMetricsAction("WebsiteSettings_Opened")); } WebsiteSettings::~WebsiteSettings() { diff --git a/chrome/browser/ui/webui/chromeos/charger_replacement_handler.cc b/chrome/browser/ui/webui/chromeos/charger_replacement_handler.cc index eff6f55..0aeed46 100644 --- a/chrome/browser/ui/webui/chromeos/charger_replacement_handler.cc +++ b/chrome/browser/ui/webui/chromeos/charger_replacement_handler.cc @@ -239,7 +239,7 @@ void ChargerReplacementHandler::SetChargerStatusPref( void ChargerReplacementHandler::ConfirmSafeCharger( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("ConfirmSafeSpringCharger")); + base::UserMetricsAction("ConfirmSafeSpringCharger")); SetChargerStatusPref(CONFIRM_SAFE_CHARGER); dialog_->set_can_close(true); @@ -248,7 +248,7 @@ void ChargerReplacementHandler::ConfirmSafeCharger( void ChargerReplacementHandler::ConfirmNotOrderNewCharger( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("ConfirmNotToOrderSpringCharger")); + base::UserMetricsAction("ConfirmNotToOrderSpringCharger")); SetChargerStatusPref(CONFIRM_NOT_ORDER_NEW_CHARGER); dialog_->set_can_close(true); @@ -257,9 +257,9 @@ void ChargerReplacementHandler::ConfirmNotOrderNewCharger( void ChargerReplacementHandler::ConfirmChargerOrderedOnline( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("ConfirmOrderSpringChargerOnline")); + base::UserMetricsAction("ConfirmOrderSpringChargerOnline")); content::RecordAction( - content::UserMetricsAction("ConfirmOrderSpringCharger")); + base::UserMetricsAction("ConfirmOrderSpringCharger")); SetChargerStatusPref(CONFIRM_NEW_CHARGER_ORDERED_ONLINE); dialog_->set_can_close(true); @@ -268,9 +268,9 @@ void ChargerReplacementHandler::ConfirmChargerOrderedOnline( void ChargerReplacementHandler::ConfirmChargerOrderByPhone( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("ConfirmOrderSpringChargerByPhone")); + base::UserMetricsAction("ConfirmOrderSpringChargerByPhone")); content::RecordAction( - content::UserMetricsAction("ConfirmOrderSpringCharger")); + base::UserMetricsAction("ConfirmOrderSpringCharger")); SetChargerStatusPref(CONFIRM_ORDER_NEW_CHARGER_BY_PHONE); dialog_->set_can_close(true); @@ -279,7 +279,7 @@ void ChargerReplacementHandler::ConfirmChargerOrderByPhone( void ChargerReplacementHandler::ConfirmStillUseBadCharger( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("ConfirmStillUseOriginalChargerAfterOrder")); + base::UserMetricsAction("ConfirmStillUseOriginalChargerAfterOrder")); if (GetChargerStatusPref() == CONFIRM_NEW_CHARGER_ORDERED_ONLINE) { SetChargerStatusPref(USE_BAD_CHARGER_AFTER_ORDER_ONLINE); diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc index 8dad0fa..8ce46f2 100644 --- a/chrome/browser/ui/webui/conflicts_ui.cc +++ b/chrome/browser/ui/webui/conflicts_ui.cc @@ -34,7 +34,7 @@ #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; using content::WebUIMessageHandler; diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc index b5d0a40..b1cd351 100644 --- a/chrome/browser/ui/webui/downloads_dom_handler.cc +++ b/chrome/browser/ui/webui/downloads_dom_handler.cc @@ -51,9 +51,9 @@ #include "ui/base/l10n/time_format.h" #include "ui/gfx/image/image.h" +using base::UserMetricsAction; using content::BrowserContext; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/webui/flash_ui.cc b/chrome/browser/ui/webui/flash_ui.cc index 7c92f4d..7809614 100644 --- a/chrome/browser/ui/webui/flash_ui.cc +++ b/chrome/browser/ui/webui/flash_ui.cc @@ -48,9 +48,9 @@ #endif using base::ASCIIToUTF16; +using base::UserMetricsAction; using content::GpuDataManager; using content::PluginService; -using content::UserMetricsAction; using content::WebContents; using content::WebUIMessageHandler; diff --git a/chrome/browser/ui/webui/help/version_updater_win.cc b/chrome/browser/ui/webui/help/version_updater_win.cc index 9491e10..b6b38e5 100644 --- a/chrome/browser/ui/webui/help/version_updater_win.cc +++ b/chrome/browser/ui/webui/help/version_updater_win.cc @@ -23,8 +23,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/views/widget/widget.h" +using base::UserMetricsAction; using content::BrowserThread; -using content::UserMetricsAction; namespace { diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc index 93b53ce..bc55c2c 100644 --- a/chrome/browser/ui/webui/inspect_ui.cc +++ b/chrome/browser/ui/webui/inspect_ui.cc @@ -237,7 +237,7 @@ void InspectUI::Open(const std::string& source_id, } void InspectUI::InspectDevices(Browser* browser) { - content::RecordAction(content::UserMetricsAction("InspectDevices")); + content::RecordAction(base::UserMetricsAction("InspectDevices")); chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( browser, GURL(chrome::kChromeUIInspectURL))); params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE; diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc index d65749f..72a0087 100644 --- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc +++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc @@ -559,7 +559,7 @@ void LocalDiscoveryUIHandler::OnCloudPrintPrefsChanged() { void LocalDiscoveryUIHandler::ShowCloudPrintSetupDialog( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("Options_EnableCloudPrintProxy")); + base::UserMetricsAction("Options_EnableCloudPrintProxy")); // Open the connector enable page in the current tab. Profile* profile = Profile::FromWebUI(web_ui()); content::OpenURLParams params( @@ -572,7 +572,7 @@ void LocalDiscoveryUIHandler::ShowCloudPrintSetupDialog( void LocalDiscoveryUIHandler::HandleDisableCloudPrintConnector( const base::ListValue* args) { content::RecordAction( - content::UserMetricsAction("Options_DisableCloudPrintProxy")); + base::UserMetricsAction("Options_DisableCloudPrintProxy")); CloudPrintProxyServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()))-> DisableForUser(); } diff --git a/chrome/browser/ui/webui/metrics_handler.cc b/chrome/browser/ui/webui/metrics_handler.cc index 6cb8309..4c0f944 100644 --- a/chrome/browser/ui/webui/metrics_handler.cc +++ b/chrome/browser/ui/webui/metrics_handler.cc @@ -21,7 +21,7 @@ #include "content/public/browser/web_ui.h" using base::ListValue; -using content::UserMetricsAction; +using base::UserMetricsAction; using content::WebContents; MetricsHandler::MetricsHandler() {} diff --git a/chrome/browser/ui/webui/nacl_ui.cc b/chrome/browser/ui/webui/nacl_ui.cc index ae977a5..c372daf 100644 --- a/chrome/browser/ui/webui/nacl_ui.cc +++ b/chrome/browser/ui/webui/nacl_ui.cc @@ -44,9 +44,9 @@ #endif using base::ASCIIToUTF16; +using base::UserMetricsAction; using content::BrowserThread; using content::PluginService; -using content::UserMetricsAction; using content::WebUIMessageHandler; namespace { diff --git a/chrome/browser/ui/webui/ntp/android/navigation_handler.cc b/chrome/browser/ui/webui/ntp/android/navigation_handler.cc index 7e02d0f..2a99dc0 100644 --- a/chrome/browser/ui/webui/ntp/android/navigation_handler.cc +++ b/chrome/browser/ui/webui/ntp/android/navigation_handler.cc @@ -16,7 +16,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/common/page_transition_types.h" -using content::UserMetricsAction; +using base::UserMetricsAction; NavigationHandler::NavigationHandler() {} diff --git a/chrome/browser/ui/webui/ntp/most_visited_handler.cc b/chrome/browser/ui/webui/ntp/most_visited_handler.cc index c5455cb..fc5da40 100644 --- a/chrome/browser/ui/webui/ntp/most_visited_handler.cc +++ b/chrome/browser/ui/webui/ntp/most_visited_handler.cc @@ -50,7 +50,7 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; MostVisitedHandler::MostVisitedHandler() : got_first_most_visited_request_(false), diff --git a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc index 396d9eb..4cc17ff 100644 --- a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc +++ b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc @@ -36,7 +36,7 @@ #include "content/public/common/page_transition_types.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; SuggestionsHandler::SuggestionsHandler() : got_first_suggestions_request_(false), diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index eb9ffb7..03ac050 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -124,12 +124,12 @@ #include "chrome/browser/local_discovery/privet_notifications.h" #endif +using base::UserMetricsAction; using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; using content::OpenURLParams; using content::Referrer; -using content::UserMetricsAction; namespace options { diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc index 82c7450..8bbcbb6 100644 --- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc @@ -36,7 +36,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { // TODO(zork): Remove this blacklist when fonts are added to Chrome OS. diff --git a/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc index 37938dd..7f3c3a4 100644 --- a/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/stats_options_handler.cc @@ -11,7 +11,7 @@ #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_ui.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace chromeos { namespace options { diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index dd20380..76b0d4e 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -49,7 +49,7 @@ #include "chrome/browser/chromeos/login/user_manager.h" #endif -using content::UserMetricsAction; +using base::UserMetricsAction; using extensions::APIPermission; namespace { diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc index 340b8ec..5ce25c5 100644 --- a/chrome/browser/ui/webui/options/core_options_handler.cc +++ b/chrome/browser/ui/webui/options/core_options_handler.cc @@ -35,7 +35,7 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace options { diff --git a/chrome/browser/ui/webui/options/language_options_handler.cc b/chrome/browser/ui/webui/options/language_options_handler.cc index 0c9ee65..82f1d57 100644 --- a/chrome/browser/ui/webui/options/language_options_handler.cc +++ b/chrome/browser/ui/webui/options/language_options_handler.cc @@ -26,7 +26,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace options { diff --git a/chrome/browser/ui/webui/options/language_options_handler_common.cc b/chrome/browser/ui/webui/options/language_options_handler_common.cc index f39be41..5c1131d 100644 --- a/chrome/browser/ui/webui/options/language_options_handler_common.cc +++ b/chrome/browser/ui/webui/options/language_options_handler_common.cc @@ -33,7 +33,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace options { diff --git a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc index 3d5b549..975891b 100644 --- a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc +++ b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc @@ -192,7 +192,7 @@ void ResetProfileSettingsHandler::ResetProfile(bool send_settings) { default_settings.Pass(), base::Bind(&ResetProfileSettingsHandler::OnResetProfileSettingsDone, AsWeakPtr())); - content::RecordAction(content::UserMetricsAction("ResetProfile")); + content::RecordAction(base::UserMetricsAction("ResetProfile")); UMA_HISTOGRAM_BOOLEAN("ProfileReset.SendFeedback", send_settings); } diff --git a/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc b/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc index 3cf23fc..d6065a3 100644 --- a/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc +++ b/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.cc @@ -5,17 +5,18 @@ #include "chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h" #include "base/bind.h" +#include "base/metrics/user_metrics.h" #include "base/values.h" #include "content/public/browser/web_ui.h" UserActionsUIHandler::UserActionsUIHandler() : action_callback_(base::Bind(&UserActionsUIHandler::OnUserAction, base::Unretained(this))) { - content::AddActionCallback(action_callback_); + base::AddActionCallback(action_callback_); } UserActionsUIHandler::~UserActionsUIHandler() { - content::RemoveActionCallback(action_callback_); + base::RemoveActionCallback(action_callback_); } void UserActionsUIHandler::RegisterMessages() {} diff --git a/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h b/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h index 9a14b85..87a19eb 100644 --- a/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h +++ b/chrome/browser/ui/webui/user_actions/user_actions_ui_handler.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_WEBUI_USER_ACTIONS_USER_ACTIONS_UI_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_USER_ACTIONS_USER_ACTIONS_UI_HANDLER_H_ -#include "content/public/browser/user_metrics.h" +#include "base/metrics/user_metrics.h" #include "content/public/browser/web_ui_message_handler.h" // UI Handler for chrome://user-actions/ @@ -23,7 +23,7 @@ class UserActionsUIHandler : public content::WebUIMessageHandler { private: void OnUserAction(const std::string& action); - content::ActionCallback action_callback_; + base::ActionCallback action_callback_; DISALLOW_COPY_AND_ASSIGN(UserActionsUIHandler); }; diff --git a/chrome/browser/web_resource/notification_promo.cc b/chrome/browser/web_resource/notification_promo.cc index 6ebfe0c..de794bc 100644 --- a/chrome/browser/web_resource/notification_promo.cc +++ b/chrome/browser/web_resource/notification_promo.cc @@ -27,7 +27,7 @@ #include "ui/base/device_form_factor.h" #include "url/gurl.h" -using content::UserMetricsAction; +using base::UserMetricsAction; namespace { diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 0e61af9..160c426 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -8,6 +8,7 @@ #include "base/debug/crash_logging.h" #include "base/logging.h" #include "base/metrics/histogram.h" +#include "base/metrics/user_metrics_action.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -119,8 +120,8 @@ using autofill::AutofillAgent; using autofill::PasswordAutofillAgent; using autofill::PasswordGenerationAgent; using base::ASCIIToUTF16; +using base::UserMetricsAction; using content::RenderThread; -using content::UserMetricsAction; using content::WebPluginInfo; using extensions::Extension; using blink::WebCache; diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc index 5dd35fc..98af97c 100644 --- a/chrome/renderer/extensions/dispatcher.cc +++ b/chrome/renderer/extensions/dispatcher.cc @@ -9,6 +9,7 @@ #include "base/debug/alias.h" #include "base/json/json_reader.h" #include "base/memory/scoped_ptr.h" +#include "base/metrics/user_metrics_action.h" #include "base/sha1.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" @@ -103,6 +104,7 @@ #include "chrome/renderer/extensions/cast_streaming_native_handler.h" #endif +using base::UserMetricsAction; using blink::WebDataSource; using blink::WebDocument; using blink::WebFrame; @@ -113,7 +115,6 @@ using blink::WebVector; using blink::WebView; using content::RenderThread; using content::RenderView; -using content::UserMetricsAction; namespace extensions { diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc index d6631e6..ed1f632 100644 --- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc +++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc @@ -28,9 +28,7 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/base/webui/jstemplate_builder.h" -using content::RenderThread; -using content::RenderView; -using content::UserMetricsAction; +using base::UserMetricsAction; using blink::WebDocument; using blink::WebElement; using blink::WebFrame; @@ -39,6 +37,8 @@ using blink::WebNode; using blink::WebPlugin; using blink::WebPluginContainer; using blink::WebPluginParams; +using content::RenderThread; +using content::RenderView; namespace { const plugins::PluginPlaceholder* g_last_active_menu = NULL; diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc index 14aff70..deb64d7 100644 --- a/components/plugins/renderer/plugin_placeholder.cc +++ b/components/plugins/renderer/plugin_placeholder.cc @@ -25,8 +25,7 @@ #include "third_party/WebKit/public/web/WebView.h" #include "third_party/re2/re2/re2.h" -using content::RenderThread; -using content::UserMetricsAction; +using base::UserMetricsAction; using blink::WebElement; using blink::WebFrame; using blink::WebMouseEvent; @@ -36,6 +35,7 @@ using blink::WebPluginContainer; using blink::WebPluginParams; using blink::WebScriptSource; using blink::WebURLRequest; +using content::RenderThread; namespace plugins { diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc index 25e33cf..2ce0d83 100644 --- a/content/browser/appcache/appcache_dispatcher_host.cc +++ b/content/browser/appcache/appcache_dispatcher_host.cc @@ -63,7 +63,7 @@ bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& message, AppCacheDispatcherHost::~AppCacheDispatcherHost() {} void AppCacheDispatcherHost::BadMessageReceived() { - RecordAction(UserMetricsAction("BadMessageTerminate_ACDH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_ACDH")); BrowserMessageFilter::BadMessageReceived(); } diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 716c2b7..03f7b18 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -69,7 +69,8 @@ class BrowserPluginGuest::PermissionRequest : } protected: PermissionRequest() { - RecordAction(UserMetricsAction("BrowserPlugin.Guest.PermissionRequest")); + RecordAction( + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest")); } virtual ~PermissionRequest() {} // Friend RefCounted so that the dtor can be non-public. @@ -81,7 +82,7 @@ class BrowserPluginGuest::DownloadRequest : public PermissionRequest { explicit DownloadRequest(base::Callback<void(bool)> callback) : callback_(callback) { RecordAction( - UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Download")); + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Download")); } virtual void Respond(bool should_allow, const std::string& user_input) OVERRIDE { @@ -102,7 +103,7 @@ class BrowserPluginGuest::GeolocationRequest : public PermissionRequest { bridge_id_(bridge_id), weak_ptr_factory_(weak_ptr_factory) { RecordAction( - UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Geolocation")); + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Geolocation")); } virtual void Respond(bool should_allow, @@ -156,7 +157,7 @@ class BrowserPluginGuest::MediaRequest : public PermissionRequest { callback_(callback), guest_(guest) { RecordAction( - UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Media")); + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.Media")); } virtual void Respond(bool should_allow, @@ -185,7 +186,7 @@ class BrowserPluginGuest::NewWindowRequest : public PermissionRequest { : instance_id_(instance_id), guest_(guest) { RecordAction( - UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.NewWindow")); + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.NewWindow")); } virtual void Respond(bool should_allow, @@ -216,7 +217,7 @@ class BrowserPluginGuest::JavaScriptDialogRequest : public PermissionRequest { JavaScriptDialogRequest(const DialogClosedCallback& callback) : callback_(callback) { RecordAction( - UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.JSDialog")); + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.JSDialog")); } virtual void Respond(bool should_allow, @@ -234,7 +235,7 @@ class BrowserPluginGuest::PointerLockRequest : public PermissionRequest { PointerLockRequest(BrowserPluginGuest* guest) : guest_(guest) { RecordAction( - UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.PointerLock")); + base::UserMetricsAction("BrowserPlugin.Guest.PermissionRequest.PointerLock")); } virtual void Respond(bool should_allow, @@ -653,7 +654,7 @@ BrowserPluginGuest* BrowserPluginGuest::Create( SiteInstance* guest_site_instance, WebContentsImpl* web_contents, scoped_ptr<base::DictionaryValue> extra_params) { - RecordAction(UserMetricsAction("BrowserPlugin.Guest.Create")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Create")); BrowserPluginGuest* guest = NULL; if (factory_) { guest = factory_->CreateBrowserPluginGuest(instance_id, web_contents); @@ -839,14 +840,14 @@ void BrowserPluginGuest::WebContentsCreated(WebContents* source_contents, } void BrowserPluginGuest::RendererUnresponsive(WebContents* source) { - RecordAction(UserMetricsAction("BrowserPlugin.Guest.Hung")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Hung")); if (!delegate_) return; delegate_->RendererUnresponsive(); } void BrowserPluginGuest::RendererResponsive(WebContents* source) { - RecordAction(UserMetricsAction("BrowserPlugin.Guest.Responsive")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Responsive")); if (!delegate_) return; delegate_->RendererResponsive(); @@ -1065,7 +1066,7 @@ void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( const GURL& url, PageTransition transition_type, RenderViewHost* render_view_host) { - RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); } void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) { @@ -1106,13 +1107,14 @@ void BrowserPluginGuest::RenderProcessGone(base::TerminationStatus status) { SendMessageToEmbedder(new BrowserPluginMsg_GuestGone(instance_id())); switch (status) { case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: - RecordAction(UserMetricsAction("BrowserPlugin.Guest.Killed")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Killed")); break; case base::TERMINATION_STATUS_PROCESS_CRASHED: - RecordAction(UserMetricsAction("BrowserPlugin.Guest.Crashed")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Crashed")); break; case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: - RecordAction(UserMetricsAction("BrowserPlugin.Guest.AbnormalDeath")); + RecordAction( + base::UserMetricsAction("BrowserPlugin.Guest.AbnormalDeath")); break; default: break; @@ -1253,7 +1255,7 @@ void BrowserPluginGuest::Attach( SendQueuedMessages(); - RecordAction(UserMetricsAction("BrowserPlugin.Guest.Attached")); + RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Attached")); } void BrowserPluginGuest::OnCompositorFrameSwappedACK( @@ -1527,7 +1529,8 @@ void BrowserPluginGuest::OnSetSize( if (auto_size_enabled_ && (!old_auto_size_enabled || (old_max_size != max_auto_size_) || (old_min_size != min_auto_size_))) { - RecordAction(UserMetricsAction("BrowserPlugin.Guest.EnableAutoResize")); + RecordAction( + base::UserMetricsAction("BrowserPlugin.Guest.EnableAutoResize")); GetWebContents()->GetRenderViewHost()->EnableAutoResize( min_auto_size_, max_auto_size_); // TODO(fsamuel): If we're changing autosize parameters, then we force diff --git a/content/browser/browser_plugin/browser_plugin_guest_manager.cc b/content/browser/browser_plugin/browser_plugin_guest_manager.cc index 2b4935c..405a233 100644 --- a/content/browser/browser_plugin/browser_plugin_guest_manager.cc +++ b/content/browser/browser_plugin/browser_plugin_guest_manager.cc @@ -49,7 +49,8 @@ BrowserPluginGuest* BrowserPluginGuestManager::CreateGuest( // creation. If the validation fails, treat it as a bad message and kill the // renderer process. if (!IsStringUTF8(params.storage_partition_id)) { - content::RecordAction(UserMetricsAction("BadMessageTerminate_BPGM")); + content::RecordAction( + base::UserMetricsAction("BadMessageTerminate_BPGM")); base::KillProcess( embedder_process_host->GetHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, false); @@ -129,7 +130,8 @@ bool BrowserPluginGuestManager::CanEmbedderAccessInstanceIDMaybeKill( int instance_id) const { if (!CanEmbedderAccessInstanceID(embedder_render_process_id, instance_id)) { // The embedder process is trying to access a guest it does not own. - content::RecordAction(UserMetricsAction("BadMessageTerminate_BPGM")); + content::RecordAction( + base::UserMetricsAction("BadMessageTerminate_BPGM")); base::KillProcess( RenderProcessHost::FromID(embedder_render_process_id)->GetHandle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, false); diff --git a/content/browser/dom_storage/dom_storage_message_filter.cc b/content/browser/dom_storage/dom_storage_message_filter.cc index fbc3880..204aa8c 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.cc +++ b/content/browser/dom_storage/dom_storage_message_filter.cc @@ -94,7 +94,7 @@ void DOMStorageMessageFilter::OnOpenStorageArea(int connection_id, const GURL& origin) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); if (!host_->OpenStorageArea(connection_id, namespace_id, origin)) { - RecordAction(UserMetricsAction("BadMessageTerminate_DSMF_1")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_DSMF_1")); BadMessageReceived(); } } @@ -109,7 +109,7 @@ void DOMStorageMessageFilter::OnLoadStorageArea(int connection_id, bool* send_log_get_messages) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); if (!host_->ExtractAreaValues(connection_id, map, send_log_get_messages)) { - RecordAction(UserMetricsAction("BadMessageTerminate_DSMF_2")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_DSMF_2")); BadMessageReceived(); } Send(new DOMStorageMsg_AsyncOperationComplete(true)); diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc index b6b89fb..6d015b8 100644 --- a/content/browser/fileapi/fileapi_message_filter.cc +++ b/content/browser/fileapi/fileapi_message_filter.cc @@ -192,7 +192,7 @@ bool FileAPIMessageFilter::OnMessageReceived( FileAPIMessageFilter::~FileAPIMessageFilter() {} void FileAPIMessageFilter::BadMessageReceived() { - RecordAction(UserMetricsAction("BadMessageTerminate_FAMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_FAMF")); BrowserMessageFilter::BadMessageReceived(); } @@ -201,9 +201,9 @@ void FileAPIMessageFilter::OnOpenFileSystem(int request_id, fileapi::FileSystemType type) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (type == fileapi::kFileSystemTypeTemporary) { - RecordAction(UserMetricsAction("OpenFileSystemTemporary")); + RecordAction(base::UserMetricsAction("OpenFileSystemTemporary")); } else if (type == fileapi::kFileSystemTypePersistent) { - RecordAction(UserMetricsAction("OpenFileSystemPersistent")); + RecordAction(base::UserMetricsAction("OpenFileSystemPersistent")); } fileapi::OpenFileSystemMode mode = fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT; diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index 5b08aa1a..0526f69 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc @@ -902,7 +902,7 @@ NavigationType NavigationControllerImpl::ClassifyNavigation( // Because the unknown entry has committed, we risk showing the wrong URL in // release builds. Instead, we'll kill the renderer process to be safe. LOG(ERROR) << "terminating renderer for bad navigation: " << params.url; - RecordAction(UserMetricsAction("BadMessageTerminate_NC")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_NC")); // Temporary code so we can get more information. Format: // http://url/foo.html#page1#max3#frame1#ids:2_Nx,1_1x,3_2 diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 6c81e0d..a41c051 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc @@ -125,7 +125,7 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { if (!msg_is_ok) { // The message had a handler, but its de-serialization failed. // Kill the renderer. - RecordAction(UserMetricsAction("BadMessageTerminate_RFH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RFH")); GetProcess()->ReceivedBadMessage(); } diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index 136908b..3452682 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc @@ -150,7 +150,8 @@ void RenderFrameHostManager::SetPendingWebUI(const NavigationEntryImpl& entry) { if (pending_web_ui_.get() && entry.bindings() != NavigationEntryImpl::kInvalidBindings && pending_web_ui_->GetBindings() != entry.bindings()) { - RecordAction(UserMetricsAction("ProcessSwapBindingsMismatch_RVHM")); + RecordAction( + base::UserMetricsAction("ProcessSwapBindingsMismatch_RVHM")); pending_web_ui_.reset(); } } diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc index 37ab771..969e359 100644 --- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc +++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc @@ -305,7 +305,7 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( if (!return_object) { NOTREACHED() << "Uh oh, couldn't find object with id " << ipc_return_object_id; - RecordAction(UserMetricsAction("BadMessageTerminate_IDBMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_IDBMF")); BadMessageReceived(); } return return_object; @@ -320,7 +320,7 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( if (!return_object) { NOTREACHED() << "Uh oh, couldn't find object with id " << ipc_return_object_id; - RecordAction(UserMetricsAction("BadMessageTerminate_IDBMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_IDBMF")); BadMessageReceived(); } return return_object; diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 4fa3fb9..d80710c 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -958,7 +958,7 @@ void ResourceDispatcherHostImpl::BeginRequest( // Reject invalid priority. if (request_data.priority < net::MINIMUM_PRIORITY || request_data.priority > net::MAXIMUM_PRIORITY) { - RecordAction(UserMetricsAction("BadMessageTerminate_RDH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RDH")); filter_->BadMessageReceived(); return; } @@ -986,7 +986,7 @@ void ResourceDispatcherHostImpl::BeginRequest( deferred_loader->CompleteTransfer(); } else { - RecordAction(UserMetricsAction("BadMessageTerminate_RDH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RDH")); filter_->BadMessageReceived(); } return; diff --git a/content/browser/renderer_host/database_message_filter.cc b/content/browser/renderer_host/database_message_filter.cc index 720cf20..4cb73a4 100644 --- a/content/browser/renderer_host/database_message_filter.cc +++ b/content/browser/renderer_host/database_message_filter.cc @@ -287,7 +287,7 @@ void DatabaseMessageFilter::OnDatabaseOpened( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!DatabaseUtil::IsValidOriginIdentifier(origin_identifier)) { - RecordAction(UserMetricsAction("BadMessageTerminate_DBMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF")); BadMessageReceived(); return; } @@ -306,7 +306,7 @@ void DatabaseMessageFilter::OnDatabaseModified( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!database_connections_.IsDatabaseOpened( origin_identifier, database_name)) { - RecordAction(UserMetricsAction("BadMessageTerminate_DBMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF")); BadMessageReceived(); return; } @@ -320,7 +320,7 @@ void DatabaseMessageFilter::OnDatabaseClosed( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!database_connections_.IsDatabaseOpened( origin_identifier, database_name)) { - RecordAction(UserMetricsAction("BadMessageTerminate_DBMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF")); BadMessageReceived(); return; } @@ -335,7 +335,7 @@ void DatabaseMessageFilter::OnHandleSqliteError( int error) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (!DatabaseUtil::IsValidOriginIdentifier(origin_identifier)) { - RecordAction(UserMetricsAction("BadMessageTerminate_DBMF")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_DBMF")); BadMessageReceived(); return; } diff --git a/content/browser/renderer_host/media/midi_host.cc b/content/browser/renderer_host/media/midi_host.cc index d6781f6..2eb5ec6 100644 --- a/content/browser/renderer_host/media/midi_host.cc +++ b/content/browser/renderer_host/media/midi_host.cc @@ -120,7 +120,7 @@ void MIDIHost::OnSendData(uint32 port, // happens here in the browser process. if (!has_sys_ex_permission_ && (std::find(data.begin(), data.end(), kSysExMessage) != data.end())) { - RecordAction(UserMetricsAction("BadMessageTerminate_MIDI")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_MIDI")); BadMessageReceived(); return; } diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index d795a6e..072998b 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1368,7 +1368,7 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) { // The message had a handler, but its de-serialization failed. // We consider this a capital crime. Kill the renderer if we have one. LOG(ERROR) << "bad message " << msg.type() << " terminating renderer."; - RecordAction(UserMetricsAction("BadMessageTerminate_BRPH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_BRPH")); ReceivedBadMessage(); } return true; @@ -1591,7 +1591,7 @@ void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, // navigation to the home page. This is often a privileged page // (chrome://newtab/) which is exactly what we don't want. *url = GURL(kAboutBlankURL); - RecordAction(UserMetricsAction("FilterURLTermiate_Invalid")); + RecordAction(base::UserMetricsAction("FilterURLTermiate_Invalid")); return; } @@ -1599,7 +1599,7 @@ void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, // The renderer treats all URLs in the about: scheme as being about:blank. // Canonicalize about: URLs to about:blank. *url = GURL(kAboutBlankURL); - RecordAction(UserMetricsAction("FilterURLTermiate_About")); + RecordAction(base::UserMetricsAction("FilterURLTermiate_About")); } // Do not allow browser plugin guests to navigate to non-web URLs, since they @@ -1613,7 +1613,7 @@ void RenderProcessHostImpl::FilterURL(RenderProcessHost* rph, // later. VLOG(1) << "Blocked URL " << url->spec(); *url = GURL(kAboutBlankURL); - RecordAction(UserMetricsAction("FilterURLTermiate_Blocked")); + RecordAction(base::UserMetricsAction("FilterURLTermiate_Blocked")); } } @@ -1789,7 +1789,8 @@ RenderProcessHost* RenderProcessHostImpl::GetProcessHostForSite( if (host && !IsSuitableHost(host, browser_context, url)) { // The registered process does not have an appropriate set of bindings for // the url. Remove it from the map so we can register a better one. - RecordAction(UserMetricsAction("BindingsMismatch_GetProcessHostPerSite")); + RecordAction( + base::UserMetricsAction("BindingsMismatch_GetProcessHostPerSite")); map->RemoveProcess(host); host = NULL; } diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 89fce50..650972a 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -1103,7 +1103,8 @@ void RenderViewHostImpl::SetWebUIProperty(const std::string& name, if (enabled_bindings_ & BINDINGS_POLICY_WEB_UI) { Send(new ViewMsg_SetWebUIProperty(GetRoutingID(), name, value)); } else { - RecordAction(UserMetricsAction("BindingsMismatchTerminate_RVH_WebUI")); + RecordAction( + base::UserMetricsAction("BindingsMismatchTerminate_RVH_WebUI")); base::KillProcess( GetProcess()->GetHandle(), content::RESULT_CODE_KILLED, false); } @@ -1290,7 +1291,7 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) { if (!msg_is_ok) { // The message had a handler, but its de-serialization failed. // Kill the renderer. - RecordAction(UserMetricsAction("BadMessageTerminate_RVH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RVH")); GetProcess()->ReceivedBadMessage(); } @@ -1377,7 +1378,7 @@ void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { run_modal_reply_msg_ = reply_msg; run_modal_opener_id_ = opener_id; - RecordAction(UserMetricsAction("ShowModalDialog")); + RecordAction(base::UserMetricsAction("ShowModalDialog")); RenderViewHostImpl* opener = RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_); @@ -1486,7 +1487,7 @@ void RenderViewHostImpl::OnNavigate(const IPC::Message& msg) { if (!CanCommitURL(validated_params.url)) { VLOG(1) << "Blocked URL " << validated_params.url.spec(); validated_params.url = GURL(kAboutBlankURL); - RecordAction(UserMetricsAction("CanCommitURL_BlockedAndKilled")); + RecordAction(base::UserMetricsAction("CanCommitURL_BlockedAndKilled")); // Kills the process. process->ReceivedBadMessage(); } diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index a5894b2..93d865b 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -512,7 +512,7 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { if (!msg_is_ok) { // The message de-serialization failed. Kill the renderer process. - RecordAction(UserMetricsAction("BadMessageTerminate_RWH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH")); GetProcess()->ReceivedBadMessage(); } return handled; @@ -1581,7 +1581,7 @@ void RenderWidgetHostImpl::OnUpdateRect( const size_t size = pixel_size.height() * pixel_size.width() * 4; if (dib->size() < size) { DLOG(WARNING) << "Transport DIB too small for given rectangle"; - RecordAction(UserMetricsAction("BadMessageTerminate_RWH1")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH1")); GetProcess()->ReceivedBadMessage(); } else { // Scroll the backing store. @@ -1712,13 +1712,13 @@ void RenderWidgetHostImpl::OnQueueSyntheticGesture( void RenderWidgetHostImpl::OnFocus() { // Only RenderViewHost can deal with that message. - RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH4")); GetProcess()->ReceivedBadMessage(); } void RenderWidgetHostImpl::OnBlur() { // Only RenderViewHost can deal with that message. - RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5")); GetProcess()->ReceivedBadMessage(); } @@ -2062,7 +2062,7 @@ void RenderWidgetHostImpl::OnTouchEventAck( void RenderWidgetHostImpl::OnUnexpectedEventAck(UnexpectedEventAckType type) { if (type == BAD_ACK_MESSAGE) { - RecordAction(UserMetricsAction("BadMessageTerminate_RWH2")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH2")); process_->ReceivedBadMessage(); } else if (type == UNEXPECTED_EVENT_TYPE) { suppress_next_char_events_ = false; @@ -2167,55 +2167,55 @@ void RenderWidgetHostImpl::MoveCaret(const gfx::Point& point) { void RenderWidgetHostImpl::Undo() { Send(new InputMsg_Undo(GetRoutingID())); - RecordAction(UserMetricsAction("Undo")); + RecordAction(base::UserMetricsAction("Undo")); } void RenderWidgetHostImpl::Redo() { Send(new InputMsg_Redo(GetRoutingID())); - RecordAction(UserMetricsAction("Redo")); + RecordAction(base::UserMetricsAction("Redo")); } void RenderWidgetHostImpl::Cut() { Send(new InputMsg_Cut(GetRoutingID())); - RecordAction(UserMetricsAction("Cut")); + RecordAction(base::UserMetricsAction("Cut")); } void RenderWidgetHostImpl::Copy() { Send(new InputMsg_Copy(GetRoutingID())); - RecordAction(UserMetricsAction("Copy")); + RecordAction(base::UserMetricsAction("Copy")); } void RenderWidgetHostImpl::CopyToFindPboard() { #if defined(OS_MACOSX) // Windows/Linux don't have the concept of a find pasteboard. Send(new InputMsg_CopyToFindPboard(GetRoutingID())); - RecordAction(UserMetricsAction("CopyToFindPboard")); + RecordAction(base::UserMetricsAction("CopyToFindPboard")); #endif } void RenderWidgetHostImpl::Paste() { Send(new InputMsg_Paste(GetRoutingID())); - RecordAction(UserMetricsAction("Paste")); + RecordAction(base::UserMetricsAction("Paste")); } void RenderWidgetHostImpl::PasteAndMatchStyle() { Send(new InputMsg_PasteAndMatchStyle(GetRoutingID())); - RecordAction(UserMetricsAction("PasteAndMatchStyle")); + RecordAction(base::UserMetricsAction("PasteAndMatchStyle")); } void RenderWidgetHostImpl::Delete() { Send(new InputMsg_Delete(GetRoutingID())); - RecordAction(UserMetricsAction("DeleteSelection")); + RecordAction(base::UserMetricsAction("DeleteSelection")); } void RenderWidgetHostImpl::SelectAll() { Send(new InputMsg_SelectAll(GetRoutingID())); - RecordAction(UserMetricsAction("SelectAll")); + RecordAction(base::UserMetricsAction("SelectAll")); } void RenderWidgetHostImpl::Unselect() { Send(new InputMsg_Unselect(GetRoutingID())); - RecordAction(UserMetricsAction("Unselect")); + RecordAction(base::UserMetricsAction("Unselect")); } bool RenderWidgetHostImpl::GotResponseToLockMouseRequest(bool allowed) { diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index a584cf6..3e4d6e7 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -2912,14 +2912,14 @@ void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { blink::WebMouseWheelEvent mouse_wheel_event = MakeWebMouseWheelEvent(event); host_->ForwardWheelEvent(mouse_wheel_event); - RecordAction(UserMetricsAction("TrackpadScroll")); + RecordAction(base::UserMetricsAction("TrackpadScroll")); } else if (event->type() == ui::ET_SCROLL_FLING_START || event->type() == ui::ET_SCROLL_FLING_CANCEL) { blink::WebGestureEvent gesture_event = MakeWebGestureEvent(event); host_->ForwardGestureEvent(gesture_event); if (event->type() == ui::ET_SCROLL_FLING_START) - RecordAction(UserMetricsAction("TrackpadScrollFling")); + RecordAction(base::UserMetricsAction("TrackpadScrollFling")); } event->SetHandled(); @@ -2988,9 +2988,9 @@ void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || event->type() == ui::ET_GESTURE_SCROLL_UPDATE || event->type() == ui::ET_GESTURE_SCROLL_END) { - RecordAction(UserMetricsAction("TouchscreenScroll")); + RecordAction(base::UserMetricsAction("TouchscreenScroll")); } else if (event->type() == ui::ET_SCROLL_FLING_START) { - RecordAction(UserMetricsAction("TouchscreenScrollFling")); + RecordAction(base::UserMetricsAction("TouchscreenScrollFling")); } } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 43b0086..c1c4e2c 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -1673,7 +1673,7 @@ void RenderWidgetHostViewMac::OnSwapCompositorFrame( if (!frame->software_frame_data) { DLOG(ERROR) << "Received unexpected frame type."; RecordAction( - UserMetricsAction("BadMessageTerminate_UnexpectedFrameType")); + base::UserMetricsAction("BadMessageTerminate_UnexpectedFrameType")); render_widget_host_->GetProcess()->ReceivedBadMessage(); return; } diff --git a/content/browser/renderer_host/software_frame_manager.cc b/content/browser/renderer_host/software_frame_manager.cc index ce5909e..cff9434 100644 --- a/content/browser/renderer_host/software_frame_manager.cc +++ b/content/browser/renderer_host/software_frame_manager.cc @@ -101,21 +101,21 @@ bool SoftwareFrameManager::SwapToNewFrame( if (!shared_memory->Map(0)) { DLOG(ERROR) << "Unable to map renderer memory."; RecordAction( - UserMetricsAction("BadMessageTerminate_SharedMemoryManager1")); + base::UserMetricsAction("BadMessageTerminate_SharedMemoryManager1")); return false; } if (shared_memory->mapped_size() < size_in_bytes) { DLOG(ERROR) << "Shared memory too small for given rectangle"; RecordAction( - UserMetricsAction("BadMessageTerminate_SharedMemoryManager2")); + base::UserMetricsAction("BadMessageTerminate_SharedMemoryManager2")); return false; } #else if (!shared_memory->Map(size_in_bytes)) { DLOG(ERROR) << "Unable to map renderer memory."; RecordAction( - UserMetricsAction("BadMessageTerminate_SharedMemoryManager1")); + base::UserMetricsAction("BadMessageTerminate_SharedMemoryManager1")); return false; } #endif diff --git a/content/browser/user_metrics.cc b/content/browser/user_metrics.cc index a1c7819..200c851 100644 --- a/content/browser/user_metrics.cc +++ b/content/browser/user_metrics.cc @@ -7,56 +7,33 @@ #include <vector> #include "base/bind.h" -#include "base/lazy_instance.h" +#include "base/metrics/user_metrics.h" #include "content/public/browser/browser_thread.h" namespace content { -namespace { -base::LazyInstance<std::vector<ActionCallback> > g_action_callbacks = - LAZY_INSTANCE_INITIALIZER; - -// Forward declare because of circular dependency. -void CallRecordOnUI(const std::string& action); - -void Record(const char *action) { +void RecordAction(const base::UserMetricsAction& action) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&CallRecordOnUI, action)); + base::Bind(&RecordAction, action)); return; } - for (size_t i = 0; i < g_action_callbacks.Get().size(); i++) - g_action_callbacks.Get()[i].Run(action); -} - -void CallRecordOnUI(const std::string& action) { - Record(action.c_str()); -} - -} // namespace - -void RecordAction(const UserMetricsAction& action) { - Record(action.str_); + base::RecordAction(action); } void RecordComputedAction(const std::string& action) { - Record(action.c_str()); -} - -void AddActionCallback(const ActionCallback& callback) { - g_action_callbacks.Get().push_back(callback); -} - -void RemoveActionCallback(const ActionCallback& callback) { - for (size_t i = 0; i < g_action_callbacks.Get().size(); i++) { - if (g_action_callbacks.Get()[i].Equals(callback)) { - g_action_callbacks.Get().erase(g_action_callbacks.Get().begin() + i); - return; - } + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + BrowserThread::PostTask( + BrowserThread::UI, + FROM_HERE, + base::Bind(&RecordComputedAction, action)); + return; } + + base::RecordComputedAction(action); } } // namespace content diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 9c088ea..125276b 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -582,7 +582,7 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, render_view_message_source_ = NULL; if (!message_is_ok) { - RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_RVD")); GetRenderProcessHost()->ReceivedBadMessage(); } @@ -1339,7 +1339,7 @@ void WebContentsImpl::CreateNewWindow( RenderProcessHost::FromID(render_process_id)->GetHandle(); if (process_handle != base::kNullProcessHandle) { RecordAction( - UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow")); + base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWindow")); base::KillProcess(process_handle, content::RESULT_CODE_KILLED, false); } return; @@ -1479,7 +1479,7 @@ void WebContentsImpl::CreateNewWidget(int render_process_id, RenderProcessHost::FromID(render_process_id)->GetHandle(); if (process_handle != base::kNullProcessHandle) { RecordAction( - UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); + base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); base::KillProcess(process_handle, content::RESULT_CODE_KILLED, false); } return; @@ -2262,7 +2262,7 @@ void WebContentsImpl::OnDidLoadResourceFromMemoryCache( } void WebContentsImpl::OnDidDisplayInsecureContent() { - RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); + RecordAction(base::UserMetricsAction("SSL.DisplayedInsecureContent")); displayed_insecure_content_ = true; SSLManager::NotifySSLInternalStateChanged( GetController().GetBrowserContext()); @@ -2272,9 +2272,9 @@ void WebContentsImpl::OnDidRunInsecureContent( const std::string& security_origin, const GURL& target_url) { LOG(WARNING) << security_origin << " ran insecure content from " << target_url.possibly_invalid_spec(); - RecordAction(UserMetricsAction("SSL.RanInsecureContent")); + RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); if (EndsWith(security_origin, kDotGoogleDotCom, false)) - RecordAction(UserMetricsAction("SSL.RanInsecureContentGoogle")); + RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); controller_.ssl_manager()->DidRunInsecureContent(security_origin); displayed_insecure_content_ = true; SSLManager::NotifySSLInternalStateChanged( diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 9b95d4d..35e2444 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -336,7 +336,7 @@ bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { if (!msg_is_ok) { NOTREACHED(); - RecordAction(UserMetricsAction("BadMessageTerminate_WPH")); + RecordAction(base::UserMetricsAction("BadMessageTerminate_WPH")); base::KillProcess( process_->GetData().handle, RESULT_CODE_KILLED_BAD_MESSAGE, false); } @@ -407,7 +407,7 @@ void WorkerProcessHost::OnForceKillWorkerProcess() { base::KillProcess( process_->GetData().handle, RESULT_CODE_NORMAL_EXIT, false); else - RecordAction(UserMetricsAction("WorkerProcess_BadProcessToKill")); + RecordAction(base::UserMetricsAction("WorkerProcess_BadProcessToKill")); } void WorkerProcessHost::RelayMessage( diff --git a/content/content_common.gypi b/content/content_common.gypi index 4e75a72..9b7a32d 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -101,7 +101,6 @@ 'public/common/url_fetcher.h', 'public/common/url_utils.cc', 'public/common/url_utils.h', - 'public/common/user_metrics_action.h', 'public/common/webplugininfo.cc', 'public/common/webplugininfo.h', 'public/common/zygote_fork_delegate_linux.h', diff --git a/content/public/browser/browser_message_filter.cc b/content/public/browser/browser_message_filter.cc index cca9d30..e72a484 100644 --- a/content/public/browser/browser_message_filter.cc +++ b/content/public/browser/browser_message_filter.cc @@ -83,7 +83,8 @@ class BrowserMessageFilter::Internal : public IPC::ChannelProxy::MessageFilter { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO) || rv) << "Must handle messages that were dispatched to another thread!"; if (!message_was_ok) { - content::RecordAction(UserMetricsAction("BadMessageTerminate_BMF")); + content::RecordAction( + base::UserMetricsAction("BadMessageTerminate_BMF")); filter_->BadMessageReceived(); } diff --git a/content/public/browser/user_metrics.h b/content/public/browser/user_metrics.h index e9480ac..118d8a9 100644 --- a/content/public/browser/user_metrics.h +++ b/content/public/browser/user_metrics.h @@ -8,50 +8,17 @@ #include <string> #include "base/callback.h" +#include "base/metrics/user_metrics_action.h" #include "content/common/content_export.h" -#include "content/public/common/user_metrics_action.h" namespace content { -// This module provides some helper functions for logging actions tracked by -// the user metrics system. - -// Record that the user performed an action. -// "Action" here means a user-generated event: -// good: "Reload", "CloseTab", and "IMEInvoked" -// not good: "SSLDialogShown", "PageLoaded", "DiskFull" -// We use this to gather anonymized information about how users are -// interacting with the browser. -// WARNING: In calls to this function, UserMetricsAction and a -// string literal parameter must be on the same line, e.g. -// content::RecordAction( -// content::UserMetricsAction("my extremely long action name")); -// This ensures that our processing scripts can associate this action's hash -// with its metric name. Therefore, it will be possible to retrieve the metric -// name from the hash later on. -// -// Once a new recorded action is added, run -// tools/metrics/actions/extract_actions.py --hash -// to generate a new mapping of [action hashes -> metric names] and send it -// out for review to be updated. -// -// For more complicated situations (like when there are many different -// possible actions), see RecordComputedAction. -CONTENT_EXPORT void RecordAction(const UserMetricsAction& action); - -// This function has identical input and behavior to RecordAction, but is -// not automatically found by the action-processing scripts. It can be used -// when it's a pain to enumerate all possible actions, but if you use this -// you need to also update the rules for extracting known actions in -// tools/metrics/actions/extract_actions.py. -CONTENT_EXPORT void RecordComputedAction(const std::string& action); - -// Called with the action string. -typedef base::Callback<void(const std::string&)> ActionCallback; +// Wrappers around functions defined in base/metrics/user_metrics.h, refer to +// that header for full documentation. These wrappers can be called from any +// thread (they will post back to the UI thread to do the recording). -// Add/remove action callbacks (see above). -CONTENT_EXPORT void AddActionCallback(const ActionCallback& callback); -CONTENT_EXPORT void RemoveActionCallback(const ActionCallback& callback); +CONTENT_EXPORT void RecordAction(const base::UserMetricsAction& action); +CONTENT_EXPORT void RecordComputedAction(const std::string& action); } // namespace content diff --git a/content/public/renderer/render_thread.h b/content/public/renderer/render_thread.h index 6af4ed8..184da1e 100644 --- a/content/public/renderer/render_thread.h +++ b/content/public/renderer/render_thread.h @@ -8,8 +8,8 @@ #include "base/basictypes.h" #include "base/callback.h" #include "base/memory/shared_memory.h" +#include "base/metrics/user_metrics_action.h" #include "content/common/content_export.h" -#include "content/public/common/user_metrics_action.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_sender.h" @@ -75,17 +75,17 @@ class CONTENT_EXPORT RenderThread : public IPC::Sender { // initialization. virtual void EnsureWebKitInitialized() = 0; - // Sends over a UserMetricsAction to be recorded by user metrics as an action. - // Once a new user metric is added, run + // Sends over a base::UserMetricsAction to be recorded by user metrics as + // an action. Once a new user metric is added, run // tools/metrics/actions/extract_actions.py --hash // to generate a new mapping of [action hashes -> metric names] and send it // out for review to be updated. - // WARNING: When using UserMetricsAction, UserMetricsAction and a string - // literal parameter must be on the same line, e.g. + // WARNING: When using base::UserMetricsAction, base::UserMetricsAction + // and a string literal parameter must be on the same line, e.g. // RenderThread::Get()->RecordAction( - // UserMetricsAction("my extremely long action name")); + // base::UserMetricsAction("my extremely long action name")); // because otherwise our processing scripts won't pick up on new actions. - virtual void RecordAction(const UserMetricsAction& action) = 0; + virtual void RecordAction(const base::UserMetricsAction& action) = 0; // Sends over a string to be recorded by user metrics as a computed action. // When you use this you need to also update the rules for extracting known diff --git a/content/public/test/mock_render_thread.cc b/content/public/test/mock_render_thread.cc index 51882d9..ec7ead8 100644 --- a/content/public/test/mock_render_thread.cc +++ b/content/public/test/mock_render_thread.cc @@ -133,7 +133,7 @@ void MockRenderThread::SetResourceDispatcherDelegate( void MockRenderThread::EnsureWebKitInitialized() { } -void MockRenderThread::RecordAction(const UserMetricsAction& action) { +void MockRenderThread::RecordAction(const base::UserMetricsAction& action) { } void MockRenderThread::RecordComputedAction(const std::string& action) { diff --git a/content/public/test/mock_render_thread.h b/content/public/test/mock_render_thread.h index 0431c74..76809a5 100644 --- a/content/public/test/mock_render_thread.h +++ b/content/public/test/mock_render_thread.h @@ -56,7 +56,7 @@ class MockRenderThread : public RenderThread { virtual void SetResourceDispatcherDelegate( ResourceDispatcherDelegate* delegate) OVERRIDE; virtual void EnsureWebKitInitialized() OVERRIDE; - virtual void RecordAction(const UserMetricsAction& action) OVERRIDE; + virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE; virtual void RecordComputedAction(const std::string& action) OVERRIDE; virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( size_t buffer_size) OVERRIDE; diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc index 9f6129b..c8db6d5 100644 --- a/content/renderer/npapi/webplugin_impl.cc +++ b/content/renderer/npapi/webplugin_impl.cc @@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/memory/linked_ptr.h" #include "base/message_loop/message_loop.h" +#include "base/metrics/user_metrics_action.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -955,7 +956,7 @@ void WebPluginImpl::didReceiveResponse(WebURLLoader* loader, &instance_size); } else if (response.httpStatusCode() == kHttpResponseSuccessStatusCode) { RenderThreadImpl::current()->RecordAction( - UserMetricsAction("Plugin_200ForByteRange")); + base::UserMetricsAction("Plugin_200ForByteRange")); // If the client issued a byte range request and the server responds with // HTTP 200 OK, it indicates that the server does not support byte range // requests. diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 50beaca..28a4621 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -736,7 +736,7 @@ void RenderThreadImpl::RegisterSchemes() { WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme); } -void RenderThreadImpl::RecordAction(const UserMetricsAction& action) { +void RenderThreadImpl::RecordAction(const base::UserMetricsAction& action) { Send(new ViewHostMsg_UserMetricsRecordAction(action.str_)); } diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 6e77c99..16d2cb4 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -10,6 +10,7 @@ #include <vector> #include "base/memory/memory_pressure_listener.h" +#include "base/metrics/user_metrics_action.h" #include "base/observer_list.h" #include "base/process/process_handle.h" #include "base/strings/string16.h" @@ -133,7 +134,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, virtual void SetResourceDispatcherDelegate( ResourceDispatcherDelegate* delegate) OVERRIDE; virtual void EnsureWebKitInitialized() OVERRIDE; - virtual void RecordAction(const UserMetricsAction& action) OVERRIDE; + virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE; virtual void RecordComputedAction(const std::string& action) OVERRIDE; virtual scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( size_t buffer_size) OVERRIDE; |