OLD | NEW |
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 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 326 } |
327 | 327 |
328 private: | 328 private: |
329 BookmarkBarView* owner_; | 329 BookmarkBarView* owner_; |
330 | 330 |
331 DISALLOW_COPY_AND_ASSIGN(OverFlowButton); | 331 DISALLOW_COPY_AND_ASSIGN(OverFlowButton); |
332 }; | 332 }; |
333 | 333 |
334 void RecordAppLaunch(Profile* profile, GURL url) { | 334 void RecordAppLaunch(Profile* profile, GURL url) { |
335 DCHECK(profile->GetExtensionService()); | 335 DCHECK(profile->GetExtensionService()); |
336 if (!profile->GetExtensionService()->IsInstalledApp(url)) | 336 const extensions::Extension* extension = |
| 337 profile->GetExtensionService()->GetInstalledApp(url); |
| 338 if (!extension) |
337 return; | 339 return; |
338 | 340 |
339 AppLauncherHandler::RecordAppLaunchType( | 341 AppLauncherHandler::RecordAppLaunchType( |
340 extension_misc::APP_LAUNCH_BOOKMARK_BAR, | 342 extension_misc::APP_LAUNCH_BOOKMARK_BAR, |
341 extensions::Manifest::TYPE_PLATFORM_APP); | 343 extension->GetType()); |
342 } | 344 } |
343 | 345 |
344 int GetNewtabHorizontalPadding() { | 346 int GetNewtabHorizontalPadding() { |
345 return chrome::IsInstantExtendedAPIEnabled() | 347 return chrome::IsInstantExtendedAPIEnabled() |
346 ? kSearchNewTabHorizontalPadding | 348 ? kSearchNewTabHorizontalPadding |
347 : BookmarkBarView::kNewtabHorizontalPadding; | 349 : BookmarkBarView::kNewtabHorizontalPadding; |
348 } | 350 } |
349 | 351 |
350 int GetNewtabVerticalPadding() { | 352 int GetNewtabVerticalPadding() { |
351 return chrome::IsInstantExtendedAPIEnabled() | 353 return chrome::IsInstantExtendedAPIEnabled() |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 return; | 1860 return; |
1859 apps_page_shortcut_->SetVisible(visible); | 1861 apps_page_shortcut_->SetVisible(visible); |
1860 UpdateBookmarksSeparatorVisibility(); | 1862 UpdateBookmarksSeparatorVisibility(); |
1861 Layout(); | 1863 Layout(); |
1862 } | 1864 } |
1863 | 1865 |
1864 void BookmarkBarView::OnAppLauncherEnabledCompleted(bool app_launcher_enabled) { | 1866 void BookmarkBarView::OnAppLauncherEnabledCompleted(bool app_launcher_enabled) { |
1865 // Disregard |app_launcher_enabled|, use apps::WasAppLauncherEnable instead. | 1867 // Disregard |app_launcher_enabled|, use apps::WasAppLauncherEnable instead. |
1866 OnAppsPageShortcutVisibilityPrefChanged(); | 1868 OnAppsPageShortcutVisibilityPrefChanged(); |
1867 } | 1869 } |
OLD | NEW |