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

Side by Side Diff: ui/views/controls/menu/menu_runner.cc

Issue 2861873002: Align the base of the shelf's context menu to the top edge of the shelf. (Closed)
Patch Set: Rebased and adressed comments. Created 3 years, 7 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
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 "ui/views/controls/menu/menu_runner.h" 5 #include "ui/views/controls/menu/menu_runner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ui/views/controls/menu/menu_runner_handler.h" 9 #include "ui/views/controls/menu/menu_runner_handler.h"
10 #include "ui/views/controls/menu/menu_runner_impl.h" 10 #include "ui/views/controls/menu/menu_runner_impl.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 switch (source_type) { 57 switch (source_type) {
58 case ui::MENU_SOURCE_NONE: 58 case ui::MENU_SOURCE_NONE:
59 case ui::MENU_SOURCE_KEYBOARD: 59 case ui::MENU_SOURCE_KEYBOARD:
60 case ui::MENU_SOURCE_MOUSE: 60 case ui::MENU_SOURCE_MOUSE:
61 anchor = MENU_ANCHOR_TOPLEFT; 61 anchor = MENU_ANCHOR_TOPLEFT;
62 break; 62 break;
63 case ui::MENU_SOURCE_TOUCH: 63 case ui::MENU_SOURCE_TOUCH:
64 case ui::MENU_SOURCE_TOUCH_EDIT_MENU: 64 case ui::MENU_SOURCE_TOUCH_EDIT_MENU:
65 anchor = MENU_ANCHOR_BOTTOMCENTER; 65 anchor = MENU_ANCHOR_BOTTOMCENTER;
66 break; 66 break;
67 case ui::MENU_SOURCE_TOUCH_SIDE_ANCHOR:
68 anchor = MENU_ANCHOR_SIDECENTER;
69 break;
70 case ui::MENU_SOURCE_TOUCH_BOTTOM_ANCHOR:
71 anchor = MENU_ANCHOR_FIXED_BOTTOMCENTER;
67 default: 72 default:
68 break; 73 break;
69 } 74 }
70 } 75 }
71 76
72 impl_->RunMenuAt(parent, button, bounds, anchor, run_types_); 77 impl_->RunMenuAt(parent, button, bounds, anchor, run_types_);
73 } 78 }
74 79
75 bool MenuRunner::IsRunning() const { 80 bool MenuRunner::IsRunning() const {
76 return impl_->IsRunning(); 81 return impl_->IsRunning();
77 } 82 }
78 83
79 void MenuRunner::Cancel() { 84 void MenuRunner::Cancel() {
80 impl_->Cancel(); 85 impl_->Cancel();
81 } 86 }
82 87
83 base::TimeTicks MenuRunner::closing_event_time() const { 88 base::TimeTicks MenuRunner::closing_event_time() const {
84 return impl_->GetClosingEventTime(); 89 return impl_->GetClosingEventTime();
85 } 90 }
86 91
87 void MenuRunner::SetRunnerHandler( 92 void MenuRunner::SetRunnerHandler(
88 std::unique_ptr<MenuRunnerHandler> runner_handler) { 93 std::unique_ptr<MenuRunnerHandler> runner_handler) {
89 runner_handler_ = std::move(runner_handler); 94 runner_handler_ = std::move(runner_handler);
90 } 95 }
91 96
92 } // namespace views 97 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698