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

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

Issue 10694060: browser: Move more files into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 virtual bool IsTriggerableEvent(const views::Event& e) OVERRIDE { 220 virtual bool IsTriggerableEvent(const views::Event& e) OVERRIDE {
221 // Left clicks and taps should show the menu contents and right clicks 221 // Left clicks and taps should show the menu contents and right clicks
222 // should show the context menu. They should not trigger the opening of 222 // should show the context menu. They should not trigger the opening of
223 // underlying urls. 223 // underlying urls.
224 if (e.type() == ui::ET_GESTURE_TAP || 224 if (e.type() == ui::ET_GESTURE_TAP ||
225 (e.IsMouseEvent() && (e.flags() & 225 (e.IsMouseEvent() && (e.flags() &
226 (ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON)))) 226 (ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON))))
227 return false; 227 return false;
228 228
229 if (e.IsMouseEvent()) 229 if (e.IsMouseEvent())
230 return browser::DispositionFromEventFlags(e.flags()) != CURRENT_TAB; 230 return chrome::DispositionFromEventFlags(e.flags()) != CURRENT_TAB;
231 return false; 231 return false;
232 } 232 }
233 233
234 virtual void OnPaint(gfx::Canvas* canvas) { 234 virtual void OnPaint(gfx::Canvas* canvas) {
235 views::MenuButton::PaintButton(canvas, views::MenuButton::PB_NORMAL); 235 views::MenuButton::PaintButton(canvas, views::MenuButton::PB_NORMAL);
236 } 236 }
237 237
238 private: 238 private:
239 scoped_ptr<ui::SlideAnimation> show_animation_; 239 scoped_ptr<ui::SlideAnimation> show_animation_;
240 240
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 if (sender->tag() == kOtherFolderButtonTag) { 1033 if (sender->tag() == kOtherFolderButtonTag) {
1034 node = model_->other_node(); 1034 node = model_->other_node();
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 browser::DispositionFromEventFlags(sender->mouse_event_flags()); 1043 chrome::DispositionFromEventFlags(sender->mouse_event_flags());
1044 1044
1045 Profile* profile = browser_->profile(); 1045 Profile* profile = browser_->profile();
1046 if (node->is_url()) { 1046 if (node->is_url()) {
1047 RecordAppLaunch(profile, node->url()); 1047 RecordAppLaunch(profile, node->url());
1048 OpenURLParams params( 1048 OpenURLParams params(
1049 node->url(), Referrer(), disposition_from_event_flags, 1049 node->url(), Referrer(), disposition_from_event_flags,
1050 content::PAGE_TRANSITION_AUTO_BOOKMARK, false); 1050 content::PAGE_TRANSITION_AUTO_BOOKMARK, false);
1051 page_navigator_->OpenURL(params); 1051 page_navigator_->OpenURL(params);
1052 } else { 1052 } else {
1053 bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile, 1053 bookmark_utils::OpenAll(GetWidget()->GetNativeWindow(), profile,
(...skipping 627 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
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_bubble_view.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698