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

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

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add VIEWS_EXPORT for unit test access Created 6 years, 5 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 | Annotate | Revision Log
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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } else if (sender == new_avatar_button()) { 351 } else if (sender == new_avatar_button()) {
352 browser_view()->ShowAvatarBubbleFromAvatarButton( 352 browser_view()->ShowAvatarBubbleFromAvatarButton(
353 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT, 353 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT,
354 signin::ManageAccountsParams()); 354 signin::ManageAccountsParams());
355 } 355 }
356 } 356 }
357 357
358 void OpaqueBrowserFrameView::OnMenuButtonClicked(views::View* source, 358 void OpaqueBrowserFrameView::OnMenuButtonClicked(views::View* source,
359 const gfx::Point& point) { 359 const gfx::Point& point) {
360 #if defined(OS_LINUX) 360 #if defined(OS_LINUX)
361 views::MenuRunner menu_runner(frame()->GetSystemMenuModel()); 361 views::MenuRunner menu_runner(frame()->GetSystemMenuModel(),
362 views::MenuRunner::HAS_MNEMONICS);
362 ignore_result(menu_runner.RunMenuAt(browser_view()->GetWidget(), 363 ignore_result(menu_runner.RunMenuAt(browser_view()->GetWidget(),
363 window_icon_, 364 window_icon_,
364 window_icon_->GetBoundsInScreen(), 365 window_icon_->GetBoundsInScreen(),
365 views::MENU_ANCHOR_TOPLEFT, 366 views::MENU_ANCHOR_TOPLEFT,
366 ui::MENU_SOURCE_MOUSE, 367 ui::MENU_SOURCE_MOUSE));
367 views::MenuRunner::HAS_MNEMONICS));
368 #endif 368 #endif
369 } 369 }
370 370
371 /////////////////////////////////////////////////////////////////////////////// 371 ///////////////////////////////////////////////////////////////////////////////
372 // OpaqueBrowserFrameView, TabIconView::TabContentsProvider implementation: 372 // OpaqueBrowserFrameView, TabIconView::TabContentsProvider implementation:
373 373
374 bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const { 374 bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const {
375 // This function is queried during the creation of the window as the 375 // This function is queried during the creation of the window as the
376 // TabIconView we host is initialized, so we need to NULL check the selected 376 // TabIconView we host is initialized, so we need to NULL check the selected
377 // WebContents because in this condition there is not yet a selected tab. 377 // WebContents because in this condition there is not yet a selected tab.
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 902
903 int OpaqueBrowserFrameView::GetTopAreaHeight() const { 903 int OpaqueBrowserFrameView::GetTopAreaHeight() const {
904 gfx::ImageSkia* frame_image = GetFrameImage(); 904 gfx::ImageSkia* frame_image = GetFrameImage();
905 int top_area_height = frame_image->height(); 905 int top_area_height = frame_image->height();
906 if (browser_view()->IsTabStripVisible()) { 906 if (browser_view()->IsTabStripVisible()) {
907 top_area_height = std::max(top_area_height, 907 top_area_height = std::max(top_area_height,
908 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); 908 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom());
909 } 909 }
910 return top_area_height; 910 return top_area_height;
911 } 911 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698