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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 1675483002: Allow use of container cbegin() and cend() methods, plus sample uses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add note about non-member cbegin() and cend(). Created 4 years, 10 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
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc ('k') | styleguide/c++/c++11.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar/browser_actions_container.h" 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 state->role = ui::AX_ROLE_GROUP; 591 state->role = ui::AX_ROLE_GROUP;
592 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS); 592 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS);
593 } 593 }
594 594
595 void BrowserActionsContainer::WriteDragDataForView(View* sender, 595 void BrowserActionsContainer::WriteDragDataForView(View* sender,
596 const gfx::Point& press_pt, 596 const gfx::Point& press_pt,
597 OSExchangeData* data) { 597 OSExchangeData* data) {
598 toolbar_actions_bar_->OnDragStarted(); 598 toolbar_actions_bar_->OnDragStarted();
599 DCHECK(data); 599 DCHECK(data);
600 600
601 ToolbarActionViews::iterator iter = std::find(toolbar_action_views_.begin(), 601 auto it = std::find(toolbar_action_views_.cbegin(),
602 toolbar_action_views_.end(), 602 toolbar_action_views_.cend(), sender);
603 sender); 603 DCHECK(it != toolbar_action_views_.cend());
604 DCHECK(iter != toolbar_action_views_.end()); 604 ToolbarActionViewController* view_controller = (*it)->view_controller();
605 ToolbarActionViewController* view_controller = (*iter)->view_controller();
606 gfx::Size size(ToolbarActionsBar::IconWidth(false), 605 gfx::Size size(ToolbarActionsBar::IconWidth(false),
607 ToolbarActionsBar::IconHeight()); 606 ToolbarActionsBar::IconHeight());
608 drag_utils::SetDragImageOnDataObject( 607 drag_utils::SetDragImageOnDataObject(
609 view_controller->GetIcon(GetCurrentWebContents(), size).AsImageSkia(), 608 view_controller->GetIcon(GetCurrentWebContents(), size).AsImageSkia(),
610 press_pt.OffsetFromOrigin(), 609 press_pt.OffsetFromOrigin(),
611 data); 610 data);
612 // Fill in the remaining info. 611 // Fill in the remaining info.
613 BrowserActionDragData drag_data(view_controller->GetId(), 612 BrowserActionDragData drag_data(view_controller->GetId(),
614 iter - toolbar_action_views_.begin()); 613 it - toolbar_action_views_.cbegin());
615 drag_data.Write(browser_->profile(), data); 614 drag_data.Write(browser_->profile(), data);
616 } 615 }
617 616
618 int BrowserActionsContainer::GetDragOperationsForView(View* sender, 617 int BrowserActionsContainer::GetDragOperationsForView(View* sender,
619 const gfx::Point& p) { 618 const gfx::Point& p) {
620 return ui::DragDropTypes::DRAG_MOVE; 619 return ui::DragDropTypes::DRAG_MOVE;
621 } 620 }
622 621
623 bool BrowserActionsContainer::CanStartDragForView(View* sender, 622 bool BrowserActionsContainer::CanStartDragForView(View* sender,
624 const gfx::Point& press_pt, 623 const gfx::Point& press_pt,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 warning_highlight_painter_.reset( 787 warning_highlight_painter_.reset(
789 views::Painter::CreateImageGridPainter(kWarningImages)); 788 views::Painter::CreateImageGridPainter(kWarningImages));
790 } 789 }
791 790
792 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { 791 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) {
793 DCHECK(active_bubble_); 792 DCHECK(active_bubble_);
794 DCHECK_EQ(active_bubble_->GetWidget(), widget); 793 DCHECK_EQ(active_bubble_->GetWidget(), widget);
795 widget->RemoveObserver(this); 794 widget->RemoveObserver(this);
796 active_bubble_ = nullptr; 795 active_bubble_ = nullptr;
797 } 796 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc ('k') | styleguide/c++/c++11.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698