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

Side by Side Diff: chrome/browser/ui/views/permission_bubble/permission_prompt_impl.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/permission_bubble/permission_prompt_impl.h" 5 #include "chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 PermissionCombobox::~PermissionCombobox() {} 110 PermissionCombobox::~PermissionCombobox() {}
111 111
112 void PermissionCombobox::GetAccessibleNodeData(ui::AXNodeData* node_data) { 112 void PermissionCombobox::GetAccessibleNodeData(ui::AXNodeData* node_data) {
113 MenuButton::GetAccessibleNodeData(node_data); 113 MenuButton::GetAccessibleNodeData(node_data);
114 node_data->SetValue(GetText()); 114 node_data->SetValue(GetText());
115 } 115 }
116 116
117 void PermissionCombobox::OnMenuButtonClicked(views::MenuButton* source, 117 void PermissionCombobox::OnMenuButtonClicked(views::MenuButton* source,
118 const gfx::Point& point, 118 const gfx::Point& point,
119 const ui::Event* event) { 119 const ui::Event* event) {
120 menu_runner_.reset(new views::MenuRunner( 120 menu_runner_.reset(
121 model_.get(), 121 new views::MenuRunner(model_.get(), views::MenuRunner::HAS_MNEMONICS));
122 views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::ASYNC));
123 122
124 gfx::Point p(point); 123 gfx::Point p(point);
125 p.Offset(-source->width(), 0); 124 p.Offset(-source->width(), 0);
126 menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), this, 125 menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), this,
127 gfx::Rect(p, gfx::Size()), views::MENU_ANCHOR_TOPLEFT, 126 gfx::Rect(p, gfx::Size()), views::MENU_ANCHOR_TOPLEFT,
128 ui::MENU_SOURCE_NONE); 127 ui::MENU_SOURCE_NONE);
129 } 128 }
130 129
131 void PermissionCombobox::PermissionChanged( 130 void PermissionCombobox::PermissionChanged(
132 const PageInfoUI::PermissionInfo& permission) { 131 const PageInfoUI::PermissionInfo& permission) {
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 } 491 }
493 492
494 void PermissionPromptImpl::Deny() { 493 void PermissionPromptImpl::Deny() {
495 if (delegate_) 494 if (delegate_)
496 delegate_->Deny(); 495 delegate_->Deny();
497 } 496 }
498 497
499 Profile* PermissionPromptImpl::GetProfile() { 498 Profile* PermissionPromptImpl::GetProfile() {
500 return browser_->profile(); 499 return browser_->profile();
501 } 500 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/page_info/permission_selector_row.cc ('k') | chrome/browser/ui/views/status_icons/status_icon_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698