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

Side by Side Diff: chrome/browser/ui/views/task_manager_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/task_manager_view.h" 5 #include "chrome/browser/ui/views/task_manager_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void TaskManagerView::ShowContextMenuForView(views::View* source, 261 void TaskManagerView::ShowContextMenuForView(views::View* source,
262 const gfx::Point& point, 262 const gfx::Point& point,
263 ui::MenuSourceType source_type) { 263 ui::MenuSourceType source_type) {
264 menu_model_.reset(new ui::SimpleMenuModel(this)); 264 menu_model_.reset(new ui::SimpleMenuModel(this));
265 265
266 for (const auto& table_column : columns_) { 266 for (const auto& table_column : columns_) {
267 menu_model_->AddCheckItem(table_column.id, 267 menu_model_->AddCheckItem(table_column.id,
268 l10n_util::GetStringUTF16(table_column.id)); 268 l10n_util::GetStringUTF16(table_column.id));
269 } 269 }
270 270
271 menu_runner_.reset(new views::MenuRunner( 271 menu_runner_.reset(new views::MenuRunner(menu_model_.get(),
272 menu_model_.get(), 272 views::MenuRunner::CONTEXT_MENU));
273 views::MenuRunner::CONTEXT_MENU | views::MenuRunner::ASYNC));
274 273
275 menu_runner_->RunMenuAt(GetWidget(), nullptr, gfx::Rect(point, gfx::Size()), 274 menu_runner_->RunMenuAt(GetWidget(), nullptr, gfx::Rect(point, gfx::Size()),
276 views::MENU_ANCHOR_TOPLEFT, source_type); 275 views::MENU_ANCHOR_TOPLEFT, source_type);
277 } 276 }
278 277
279 bool TaskManagerView::IsCommandIdChecked(int id) const { 278 bool TaskManagerView::IsCommandIdChecked(int id) const {
280 return tab_table_->IsColumnVisible(id); 279 return tab_table_->IsColumnVisible(id);
281 } 280 }
282 281
283 bool TaskManagerView::IsCommandIdEnabled(int id) const { 282 bool TaskManagerView::IsCommandIdEnabled(int id) const {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 if (!g_browser_process->local_state()) 365 if (!g_browser_process->local_state())
367 return; 366 return;
368 367
369 const base::DictionaryValue* dictionary = 368 const base::DictionaryValue* dictionary =
370 g_browser_process->local_state()->GetDictionary(GetWindowName()); 369 g_browser_process->local_state()->GetDictionary(GetWindowName());
371 if (dictionary) 370 if (dictionary)
372 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 371 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
373 } 372 }
374 373
375 } // namespace task_manager 374 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc ('k') | chrome/browser/ui/views/toolbar/app_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698