| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 " ythickness = 0\n" | 102 " ythickness = 0\n" |
| 103 " GtkWidget::focus-padding = 0\n" | 103 " GtkWidget::focus-padding = 0\n" |
| 104 " GtkContainer::border-width = 0\n" | 104 " GtkContainer::border-width = 0\n" |
| 105 " GtkToolbar::internal-padding = 1\n" | 105 " GtkToolbar::internal-padding = 1\n" |
| 106 " GtkToolbar::shadow-type = GTK_SHADOW_NONE\n" | 106 " GtkToolbar::shadow-type = GTK_SHADOW_NONE\n" |
| 107 "}\n" | 107 "}\n" |
| 108 "widget \"*chrome-bookmark-toolbar\" style \"chrome-bookmark-toolbar\""); | 108 "widget \"*chrome-bookmark-toolbar\" style \"chrome-bookmark-toolbar\""); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void RecordAppLaunch(Profile* profile, GURL url) { | 111 void RecordAppLaunch(Profile* profile, GURL url) { |
| 112 // TODO: the ExtensionService should never be NULL, but in some cases it is, | 112 DCHECK(profile->GetExtensionService()); |
| 113 // see bug 73768. After it is resolved, the explicit test can go away. | 113 if (!profile->GetExtensionService()->IsInstalledApp(url)) |
| 114 ExtensionService* service = profile->GetExtensionService(); | |
| 115 if (!service || !service->IsInstalledApp(url)) | |
| 116 return; | 114 return; |
| 117 | 115 |
| 118 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 116 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
| 119 extension_misc::APP_LAUNCH_BOOKMARK_BAR, | 117 extension_misc::APP_LAUNCH_BOOKMARK_BAR, |
| 120 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 118 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 121 } | 119 } |
| 122 | 120 |
| 123 } // namespace | 121 } // namespace |
| 124 | 122 |
| 125 const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57; | 123 const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57; |
| (...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 | 1433 |
| 1436 // Find the GtkWidget* for the actual target button. | 1434 // Find the GtkWidget* for the actual target button. |
| 1437 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1435 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
| 1438 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1436 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
| 1439 PopupForButton(folder_list[button_idx]); | 1437 PopupForButton(folder_list[button_idx]); |
| 1440 } | 1438 } |
| 1441 | 1439 |
| 1442 void BookmarkBarGtk::CloseMenu() { | 1440 void BookmarkBarGtk::CloseMenu() { |
| 1443 current_context_menu_->Cancel(); | 1441 current_context_menu_->Cancel(); |
| 1444 } | 1442 } |
| OLD | NEW |