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

Side by Side Diff: ui/base/models/accelerator_cocoa.mm

Issue 8695005: Move accelerator related files to ui/base/accelerators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« no previous file with comments | « ui/base/models/accelerator_cocoa.h ('k') | ui/base/models/accelerator_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/base/models/accelerator_cocoa.h"
6
7 namespace ui {
8
9 AcceleratorCocoa::AcceleratorCocoa() : Accelerator() {}
10
11 AcceleratorCocoa::AcceleratorCocoa(NSString* key_code, NSUInteger mask)
12 : Accelerator(ui::VKEY_UNKNOWN, mask),
13 characters_([key_code copy]) {
14 }
15
16 AcceleratorCocoa::AcceleratorCocoa(const AcceleratorCocoa& accelerator)
17 : Accelerator(accelerator) {
18 characters_.reset([accelerator.characters_ copy]);
19 }
20
21 AcceleratorCocoa::~AcceleratorCocoa() {}
22
23 AcceleratorCocoa& AcceleratorCocoa::operator=(
24 const AcceleratorCocoa& accelerator) {
25 if (this != &accelerator) {
26 *static_cast<Accelerator*>(this) = accelerator;
27 characters_.reset([accelerator.characters_ copy]);
28 }
29 return *this;
30 }
31
32 bool AcceleratorCocoa::operator==(const AcceleratorCocoa& rhs) const {
33 return [characters_ isEqualToString:rhs.characters_.get()] &&
34 (modifiers_ == rhs.modifiers_);
35 }
36
37 bool AcceleratorCocoa::operator!=(const AcceleratorCocoa& rhs) const {
38 return !(*this == rhs);
39 }
40
41 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/models/accelerator_cocoa.h ('k') | ui/base/models/accelerator_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698