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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 725853002: Move app launch metric recording code from NTP to chrome/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More mac Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/mac/mac_util.h" 8 #include "base/mac/mac_util.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 26 matching lines...) Expand all
37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" 37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
38 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" 38 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h"
39 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 39 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
40 #import "chrome/browser/ui/cocoa/menu_button.h" 40 #import "chrome/browser/ui/cocoa/menu_button.h"
41 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" 41 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h"
42 #import "chrome/browser/ui/cocoa/themed_window.h" 42 #import "chrome/browser/ui/cocoa/themed_window.h"
43 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 43 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
44 #import "chrome/browser/ui/cocoa/view_id_util.h" 44 #import "chrome/browser/ui/cocoa/view_id_util.h"
45 #import "chrome/browser/ui/cocoa/view_resizer.h" 45 #import "chrome/browser/ui/cocoa/view_resizer.h"
46 #include "chrome/browser/ui/tabs/tab_strip_model.h" 46 #include "chrome/browser/ui/tabs/tab_strip_model.h"
47 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
48 #include "chrome/common/extensions/extension_constants.h" 47 #include "chrome/common/extensions/extension_constants.h"
48 #include "chrome/common/extensions/extension_metrics.h"
49 #include "chrome/common/pref_names.h" 49 #include "chrome/common/pref_names.h"
50 #include "chrome/common/url_constants.h" 50 #include "chrome/common/url_constants.h"
51 #include "chrome/grit/generated_resources.h" 51 #include "chrome/grit/generated_resources.h"
52 #include "components/bookmarks/browser/bookmark_model.h" 52 #include "components/bookmarks/browser/bookmark_model.h"
53 #include "components/bookmarks/browser/bookmark_node_data.h" 53 #include "components/bookmarks/browser/bookmark_node_data.h"
54 #include "components/bookmarks/browser/bookmark_utils.h" 54 #include "components/bookmarks/browser/bookmark_utils.h"
55 #include "content/public/browser/user_metrics.h" 55 #include "content/public/browser/user_metrics.h"
56 #include "content/public/browser/web_contents.h" 56 #include "content/public/browser/web_contents.h"
57 #include "extensions/browser/extension_registry.h" 57 #include "extensions/browser/extension_registry.h"
58 #include "extensions/common/extension.h" 58 #include "extensions/common/extension.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; 136 const NSTimeInterval kBookmarkBarAnimationDuration = 0.12;
137 const NSTimeInterval kDragAndDropAnimationDuration = 0.25; 137 const NSTimeInterval kDragAndDropAnimationDuration = 0.25;
138 138
139 void RecordAppLaunch(Profile* profile, GURL url) { 139 void RecordAppLaunch(Profile* profile, GURL url) {
140 const extensions::Extension* extension = 140 const extensions::Extension* extension =
141 extensions::ExtensionRegistry::Get(profile)-> 141 extensions::ExtensionRegistry::Get(profile)->
142 enabled_extensions().GetAppByURL(url); 142 enabled_extensions().GetAppByURL(url);
143 if (!extension) 143 if (!extension)
144 return; 144 return;
145 145
146 CoreAppLauncherHandler::RecordAppLaunchType( 146 extensions::RecordAppLaunchType(extension_misc::APP_LAUNCH_BOOKMARK_BAR,
147 extension_misc::APP_LAUNCH_BOOKMARK_BAR, 147 extension->GetType());
148 extension->GetType());
149 } 148 }
150 149
151 } // namespace 150 } // namespace
152 151
153 @interface BookmarkBarController(Private) 152 @interface BookmarkBarController(Private)
154 153
155 // Moves to the given next state (from the current state), possibly animating. 154 // Moves to the given next state (from the current state), possibly animating.
156 // If |animate| is NO, it will stop any running animation and jump to the given 155 // If |animate| is NO, it will stop any running animation and jump to the given
157 // state. If YES, it may either (depending on implementation) jump to the end of 156 // state. If YES, it may either (depending on implementation) jump to the end of
158 // the current animation and begin the next one, or stop the current animation 157 // the current animation and begin the next one, or stop the current animation
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2813 - (id<BookmarkButtonControllerProtocol>)controllerForNode: 2812 - (id<BookmarkButtonControllerProtocol>)controllerForNode:
2814 (const BookmarkNode*)node { 2813 (const BookmarkNode*)node {
2815 // See if it's in the bar, then if it is in the hierarchy of visible 2814 // See if it's in the bar, then if it is in the hierarchy of visible
2816 // folder menus. 2815 // folder menus.
2817 if (bookmarkModel_->bookmark_bar_node() == node) 2816 if (bookmarkModel_->bookmark_bar_node() == node)
2818 return self; 2817 return self;
2819 return [folderController_ controllerForNode:node]; 2818 return [folderController_ controllerForNode:node];
2820 } 2819 }
2821 2820
2822 @end 2821 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698