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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 10692164: Remove browser::FindTabbedBrowser call in bookmark_utils.cc. All callers, with the exception of met… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 months 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 | Annotate | Revision Log
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 #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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } else { 1035 } else {
1036 int index = GetIndexOf(sender); 1036 int index = GetIndexOf(sender);
1037 DCHECK_NE(-1, index); 1037 DCHECK_NE(-1, index);
1038 node = model_->bookmark_bar_node()->GetChild(index); 1038 node = model_->bookmark_bar_node()->GetChild(index);
1039 } 1039 }
1040 DCHECK(page_navigator_); 1040 DCHECK(page_navigator_);
1041 1041
1042 WindowOpenDisposition disposition_from_event_flags = 1042 WindowOpenDisposition disposition_from_event_flags =
1043 chrome::DispositionFromEventFlags(sender->mouse_event_flags()); 1043 chrome::DispositionFromEventFlags(sender->mouse_event_flags());
1044 1044
1045 Profile* profile = browser_->profile();
1046 if (node->is_url()) { 1045 if (node->is_url()) {
1047 RecordAppLaunch(profile, node->url()); 1046 RecordAppLaunch(browser_->profile(), node->url());
1048 OpenURLParams params( 1047 OpenURLParams params(
1049 node->url(), Referrer(), disposition_from_event_flags, 1048 node->url(), Referrer(), disposition_from_event_flags,
1050 content::PAGE_TRANSITION_AUTO_BOOKMARK, false); 1049 content::PAGE_TRANSITION_AUTO_BOOKMARK, false);
1051 page_navigator_->OpenURL(params); 1050 page_navigator_->OpenURL(params);
1052 } else { 1051 } else {
1053 bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile, 1052 bookmark_utils::OpenAll(
1054 page_navigator_, node, disposition_from_event_flags); 1053 GetWidget()->GetNativeWindow(), page_navigator_, node,
1054 disposition_from_event_flags);
1055 } 1055 }
1056 1056
1057 bookmark_utils::RecordBookmarkLaunch(IsDetached() ? 1057 bookmark_utils::RecordBookmarkLaunch(IsDetached() ?
1058 bookmark_utils::LAUNCH_DETACHED_BAR : 1058 bookmark_utils::LAUNCH_DETACHED_BAR :
1059 bookmark_utils::LAUNCH_ATTACHED_BAR); 1059 bookmark_utils::LAUNCH_ATTACHED_BAR);
1060 content::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton")); 1060 content::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
1061 } 1061 }
1062 1062
1063 void BookmarkBarView::ShowContextMenuForView(views::View* source, 1063 void BookmarkBarView::ShowContextMenuForView(views::View* source,
1064 const gfx::Point& point) { 1064 const gfx::Point& point) {
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 (1 - size_animation_->GetCurrentValue()))); 1681 (1 - size_animation_->GetCurrentValue())));
1682 } else { 1682 } else {
1683 prefsize.set_height( 1683 prefsize.set_height(
1684 static_cast<int>( 1684 static_cast<int>(
1685 browser_defaults::kBookmarkBarHeight * 1685 browser_defaults::kBookmarkBarHeight *
1686 size_animation_->GetCurrentValue())); 1686 size_animation_->GetCurrentValue()));
1687 } 1687 }
1688 } 1688 }
1689 return prefsize; 1689 return prefsize;
1690 } 1690 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698