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

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 2790773002: Cleanup MenuRunner API (Closed)
Patch Set: Rebase Created 3 years, 8 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 "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/themes/theme_service_factory.h" 9 #include "chrome/browser/themes/theme_service_factory.h"
10 #include "chrome/browser/ui/layout_constants.h" 10 #include "chrome/browser/ui/layout_constants.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 frame()->Close(); 288 frame()->Close();
289 } 289 }
290 } 290 }
291 291
292 void OpaqueBrowserFrameView::OnMenuButtonClicked(views::MenuButton* source, 292 void OpaqueBrowserFrameView::OnMenuButtonClicked(views::MenuButton* source,
293 const gfx::Point& point, 293 const gfx::Point& point,
294 const ui::Event* event) { 294 const ui::Event* event) {
295 #if defined(OS_LINUX) 295 #if defined(OS_LINUX)
296 views::MenuRunner menu_runner(frame()->GetSystemMenuModel(), 296 views::MenuRunner menu_runner(frame()->GetSystemMenuModel(),
297 views::MenuRunner::HAS_MNEMONICS); 297 views::MenuRunner::HAS_MNEMONICS);
298 ignore_result(menu_runner.RunMenuAt(browser_view()->GetWidget(), 298 menu_runner.RunMenuAt(browser_view()->GetWidget(), window_icon_,
299 window_icon_, 299 window_icon_->GetBoundsInScreen(),
300 window_icon_->GetBoundsInScreen(), 300 views::MENU_ANCHOR_TOPLEFT, ui::MENU_SOURCE_MOUSE);
301 views::MENU_ANCHOR_TOPLEFT,
302 ui::MENU_SOURCE_MOUSE));
303 #endif 301 #endif
304 } 302 }
305 303
306 /////////////////////////////////////////////////////////////////////////////// 304 ///////////////////////////////////////////////////////////////////////////////
307 // OpaqueBrowserFrameView, TabIconView::TabContentsProvider implementation: 305 // OpaqueBrowserFrameView, TabIconView::TabContentsProvider implementation:
308 306
309 bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const { 307 bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const {
310 // This function is queried during the creation of the window as the 308 // This function is queried during the creation of the window as the
311 // TabIconView we host is initialized, so we need to null check the selected 309 // TabIconView we host is initialized, so we need to null check the selected
312 // WebContents because in this condition there is not yet a selected tab. 310 // WebContents because in this condition there is not yet a selected tab.
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 gfx::Rect side(x, y, kClientEdgeThickness, h); 663 gfx::Rect side(x, y, kClientEdgeThickness, h);
666 canvas->FillRect(side, color); 664 canvas->FillRect(side, color);
667 if (draw_bottom) { 665 if (draw_bottom) {
668 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), 666 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness),
669 kClientEdgeThickness), 667 kClientEdgeThickness),
670 color); 668 color);
671 } 669 }
672 side.Offset(w + kClientEdgeThickness, 0); 670 side.Offset(w + kClientEdgeThickness, 0);
673 canvas->FillRect(side, color); 671 canvas->FillRect(side, color);
674 } 672 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame.cc ('k') | chrome/browser/ui/views/menu_model_adapter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698