| 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/bookmark_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/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 if (!profile->GetExtensionService()->IsInstalledApp(url)) | 112 // TODO: the ExtensionService should never be NULL, but in some cases it is, |
| 113 // see bug 73768. After it is resolved, the explicit test can go away. |
| 114 ExtensionService* service = profile->GetExtensionService(); |
| 115 if (!service || !service->IsInstalledApp(url)) |
| 113 return; | 116 return; |
| 114 | 117 |
| 115 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 118 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
| 116 extension_misc::APP_LAUNCH_BOOKMARK_BAR, | 119 extension_misc::APP_LAUNCH_BOOKMARK_BAR, |
| 117 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 120 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 118 } | 121 } |
| 119 | 122 |
| 120 } // namespace | 123 } // namespace |
| 121 | 124 |
| 122 const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57; | 125 const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57; |
| (...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 | 1435 |
| 1433 // Find the GtkWidget* for the actual target button. | 1436 // Find the GtkWidget* for the actual target button. |
| 1434 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1437 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
| 1435 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1438 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
| 1436 PopupForButton(folder_list[button_idx]); | 1439 PopupForButton(folder_list[button_idx]); |
| 1437 } | 1440 } |
| 1438 | 1441 |
| 1439 void BookmarkBarGtk::CloseMenu() { | 1442 void BookmarkBarGtk::CloseMenu() { |
| 1440 current_context_menu_->Cancel(); | 1443 current_context_menu_->Cancel(); |
| 1441 } | 1444 } |
| OLD | NEW |