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

Side by Side Diff: ui/views/view.cc

Issue 2230183002: ui: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 | « ui/views/mus/clipboard_mus.cc ('k') | ui/wm/core/transient_window_manager.cc » ('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 (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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 ui::LocatedEvent* event) { 1102 ui::LocatedEvent* event) {
1103 event->ConvertLocationToTarget(this, static_cast<View*>(target)); 1103 event->ConvertLocationToTarget(this, static_cast<View*>(target));
1104 } 1104 }
1105 1105
1106 // Accelerators ---------------------------------------------------------------- 1106 // Accelerators ----------------------------------------------------------------
1107 1107
1108 void View::AddAccelerator(const ui::Accelerator& accelerator) { 1108 void View::AddAccelerator(const ui::Accelerator& accelerator) {
1109 if (!accelerators_.get()) 1109 if (!accelerators_.get())
1110 accelerators_.reset(new std::vector<ui::Accelerator>()); 1110 accelerators_.reset(new std::vector<ui::Accelerator>());
1111 1111
1112 if (!ContainsValue(*accelerators_.get(), accelerator)) 1112 if (!base::ContainsValue(*accelerators_.get(), accelerator))
1113 accelerators_->push_back(accelerator); 1113 accelerators_->push_back(accelerator);
1114 1114
1115 RegisterPendingAccelerators(); 1115 RegisterPendingAccelerators();
1116 } 1116 }
1117 1117
1118 void View::RemoveAccelerator(const ui::Accelerator& accelerator) { 1118 void View::RemoveAccelerator(const ui::Accelerator& accelerator) {
1119 if (!accelerators_.get()) { 1119 if (!accelerators_.get()) {
1120 NOTREACHED() << "Removing non-existing accelerator"; 1120 NOTREACHED() << "Removing non-existing accelerator";
1121 return; 1121 return;
1122 } 1122 }
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 // Message the RootView to do the drag and drop. That way if we're removed 2420 // Message the RootView to do the drag and drop. That way if we're removed
2421 // the RootView can detect it and avoid calling us back. 2421 // the RootView can detect it and avoid calling us back.
2422 gfx::Point widget_location(event.location()); 2422 gfx::Point widget_location(event.location());
2423 ConvertPointToWidget(this, &widget_location); 2423 ConvertPointToWidget(this, &widget_location);
2424 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2424 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2425 // WARNING: we may have been deleted. 2425 // WARNING: we may have been deleted.
2426 return true; 2426 return true;
2427 } 2427 }
2428 2428
2429 } // namespace views 2429 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/clipboard_mus.cc ('k') | ui/wm/core/transient_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698