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

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

Issue 1606053002: fix 'set but not used' GCC warning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 2262
2263 MenuMessageLoop::RepostEventToWindow(event, window, screen_loc); 2263 MenuMessageLoop::RepostEventToWindow(event, window, screen_loc);
2264 } 2264 }
2265 2265
2266 void MenuController::RepostEventAndCancel(SubmenuView* source, 2266 void MenuController::RepostEventAndCancel(SubmenuView* source,
2267 const ui::LocatedEvent* event) { 2267 const ui::LocatedEvent* event) {
2268 // Cancel can lead to the deletion |source| so we save the view and window to 2268 // Cancel can lead to the deletion |source| so we save the view and window to
2269 // be used when reposting the event. 2269 // be used when reposting the event.
2270 gfx::Point screen_loc(event->location()); 2270 gfx::Point screen_loc(event->location());
2271 View::ConvertPointToScreen(source->GetScrollViewContainer(), &screen_loc); 2271 View::ConvertPointToScreen(source->GetScrollViewContainer(), &screen_loc);
2272
2273 #if defined(OS_WIN) || defined(OS_CHROMEOS)
2272 gfx::NativeView native_view = source->GetWidget()->GetNativeView(); 2274 gfx::NativeView native_view = source->GetWidget()->GetNativeView();
2273 gfx::NativeWindow window = nullptr; 2275 gfx::NativeWindow window = nullptr;
2274 if (native_view) { 2276 if (native_view) {
2275 gfx::Screen* screen = gfx::Screen::GetScreenFor(native_view); 2277 gfx::Screen* screen = gfx::Screen::GetScreenFor(native_view);
2276 window = screen->GetWindowAtScreenPoint(screen_loc); 2278 window = screen->GetWindowAtScreenPoint(screen_loc);
2277 } 2279 }
2280 #endif
2278 2281
2279 #if defined(OS_WIN) 2282 #if defined(OS_WIN)
2280 // We're going to close and we own the event capture. We need to repost the 2283 // We're going to close and we own the event capture. We need to repost the
2281 // event, otherwise the window the user clicked on won't get the event. 2284 // event, otherwise the window the user clicked on won't get the event.
2282 RepostEvent(source, event, screen_loc, native_view, window); 2285 RepostEvent(source, event, screen_loc, native_view, window);
2283 #endif 2286 #endif
2284 2287
2285 // Determine target to see if a complete or partial close of the menu should 2288 // Determine target to see if a complete or partial close of the menu should
2286 // occur. 2289 // occur.
2287 ExitType exit_type = EXIT_ALL; 2290 ExitType exit_type = EXIT_ALL;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 } 2571 }
2569 } 2572 }
2570 2573
2571 gfx::Screen* MenuController::GetScreen() { 2574 gfx::Screen* MenuController::GetScreen() {
2572 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL; 2575 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL;
2573 return root ? gfx::Screen::GetScreenFor(root->GetNativeView()) 2576 return root ? gfx::Screen::GetScreenFor(root->GetNativeView())
2574 : gfx::Screen::GetNativeScreen(); 2577 : gfx::Screen::GetNativeScreen();
2575 } 2578 }
2576 2579
2577 } // namespace views 2580 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698