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

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.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/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/metrics/user_metrics.h" 9 #include "base/metrics/user_metrics.h"
10 #include "base/task_scheduler/post_task.h" 10 #include "base/task_scheduler/post_task.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 ~TabContextMenuContents() override { 118 ~TabContextMenuContents() override {
119 if (controller_) 119 if (controller_)
120 controller_->tabstrip_->StopAllHighlighting(); 120 controller_->tabstrip_->StopAllHighlighting();
121 } 121 }
122 122
123 void Cancel() { 123 void Cancel() {
124 controller_ = NULL; 124 controller_ = NULL;
125 } 125 }
126 126
127 void RunMenuAt(const gfx::Point& point, ui::MenuSourceType source_type) { 127 void RunMenuAt(const gfx::Point& point, ui::MenuSourceType source_type) {
128 if (menu_runner_->RunMenuAt(tab_->GetWidget(), 128 menu_runner_->RunMenuAt(tab_->GetWidget(), NULL,
129 NULL, 129 gfx::Rect(point, gfx::Size()),
130 gfx::Rect(point, gfx::Size()), 130 views::MENU_ANCHOR_TOPLEFT, source_type);
131 views::MENU_ANCHOR_TOPLEFT,
132 source_type) ==
133 views::MenuRunner::MENU_DELETED) {
134 return;
135 }
136 } 131 }
137 132
138 // Overridden from ui::SimpleMenuModel::Delegate: 133 // Overridden from ui::SimpleMenuModel::Delegate:
139 bool IsCommandIdChecked(int command_id) const override { return false; } 134 bool IsCommandIdChecked(int command_id) const override { return false; }
140 bool IsCommandIdEnabled(int command_id) const override { 135 bool IsCommandIdEnabled(int command_id) const override {
141 return controller_->IsCommandEnabledForTab( 136 return controller_->IsCommandEnabledForTab(
142 static_cast<TabStripModel::ContextMenuCommand>(command_id), 137 static_cast<TabStripModel::ContextMenuCommand>(command_id),
143 tab_); 138 tab_);
144 } 139 }
145 bool GetAcceleratorForCommandId(int command_id, 140 bool GetAcceleratorForCommandId(int command_id,
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 content::WebPluginInfo plugin; 582 content::WebPluginInfo plugin;
588 tabstrip_->FileSupported( 583 tabstrip_->FileSupported(
589 url, 584 url,
590 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || 585 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) ||
591 content::PluginService::GetInstance()->GetPluginInfo( 586 content::PluginService::GetInstance()->GetPluginInfo(
592 -1, // process ID 587 -1, // process ID
593 MSG_ROUTING_NONE, // routing ID 588 MSG_ROUTING_NONE, // routing ID
594 model_->profile()->GetResourceContext(), url, url::Origin(), 589 model_->profile()->GetResourceContext(), url, url::Origin(),
595 mime_type, false, NULL, &plugin, NULL)); 590 mime_type, false, NULL, &plugin, NULL));
596 } 591 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_icon_win.cc ('k') | chrome/browser/ui/views/task_manager_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698