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

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: nits. 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
« no previous file with comments | « ui/views/controls/menu/menu_runner.h ('k') | ui/views/controls/menu/menu_types.h » ('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 #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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 // The parent of the nested menu will have created a DisplayChangeListener, so 48 // The parent of the nested menu will have created a DisplayChangeListener, so
49 // we avoid creating a DisplayChangeListener if nested. Drop menus are 49 // we avoid creating a DisplayChangeListener if nested. Drop menus are
50 // transient, so we don't cancel in that case. 50 // transient, so we don't cancel in that case.
51 if ((run_types_ & (IS_NESTED | FOR_DROP)) == 0 && parent) { 51 if ((run_types_ & (IS_NESTED | FOR_DROP)) == 0 && parent) {
52 display_change_listener_.reset( 52 display_change_listener_.reset(
53 internal::DisplayChangeListener::Create(parent, this)); 53 internal::DisplayChangeListener::Create(parent, this));
54 } 54 }
55 55
56 if (run_types_ & CONTEXT_MENU) { 56 if ((run_types_ & CONTEXT_MENU) && !(run_types_ & FIXED_ANCHOR)) {
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;
(...skipping 16 matching lines...) Expand all
83 base::TimeTicks MenuRunner::closing_event_time() const { 83 base::TimeTicks MenuRunner::closing_event_time() const {
84 return impl_->GetClosingEventTime(); 84 return impl_->GetClosingEventTime();
85 } 85 }
86 86
87 void MenuRunner::SetRunnerHandler( 87 void MenuRunner::SetRunnerHandler(
88 std::unique_ptr<MenuRunnerHandler> runner_handler) { 88 std::unique_ptr<MenuRunnerHandler> runner_handler) {
89 runner_handler_ = std::move(runner_handler); 89 runner_handler_ = std::move(runner_handler);
90 } 90 }
91 91
92 } // namespace views 92 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_runner.h ('k') | ui/views/controls/menu/menu_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698