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

Side by Side Diff: chrome/browser/ui/extensions/extension_action_view_controller.cc

Issue 1782223002: [Extensions UI] Update ToolbarActionsBar::NeedsOverflow() for popped out actions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 4 years, 9 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/extensions/extension_action_view_controller.h" 5 #include "chrome/browser/ui/extensions/extension_action_view_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 popup_host_observer_.Add(popup_host_); 317 popup_host_observer_.Add(popup_host_);
318 if (toolbar_actions_bar_) 318 if (toolbar_actions_bar_)
319 toolbar_actions_bar_->SetPopupOwner(this); 319 toolbar_actions_bar_->SetPopupOwner(this);
320 320
321 if (toolbar_actions_bar_ && 321 if (toolbar_actions_bar_ &&
322 !toolbar_actions_bar_->IsActionVisibleOnMainBar(this) && 322 !toolbar_actions_bar_->IsActionVisibleOnMainBar(this) &&
323 extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()) { 323 extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()) {
324 platform_delegate_->CloseOverflowMenu(); 324 platform_delegate_->CloseOverflowMenu();
325 toolbar_actions_bar_->PopOutAction( 325 toolbar_actions_bar_->PopOutAction(
326 this, 326 this,
327 show_action == SHOW_POPUP_AND_INSPECT,
327 base::Bind(&ExtensionActionViewController::ShowPopup, 328 base::Bind(&ExtensionActionViewController::ShowPopup,
328 weak_factory_.GetWeakPtr(), base::Passed(std::move(host)), 329 weak_factory_.GetWeakPtr(), base::Passed(std::move(host)),
329 grant_tab_permissions, show_action)); 330 grant_tab_permissions, show_action));
330 } else { 331 } else {
331 ShowPopup(std::move(host), grant_tab_permissions, show_action); 332 ShowPopup(std::move(host), grant_tab_permissions, show_action);
332 } 333 }
333 334
334 return true; 335 return true;
335 } 336 }
336 337
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 extensions::ExtensionActionAPI::Get(browser_->profile()); 397 extensions::ExtensionActionAPI::Get(browser_->profile());
397 bool has_blocked_actions = api->HasBeenBlocked(extension(), web_contents); 398 bool has_blocked_actions = api->HasBeenBlocked(extension(), web_contents);
398 image_source->set_paint_blocked_actions_decoration(has_blocked_actions); 399 image_source->set_paint_blocked_actions_decoration(has_blocked_actions);
399 image_source->set_paint_page_action_decoration( 400 image_source->set_paint_page_action_decoration(
400 !has_blocked_actions && is_overflow && 401 !has_blocked_actions && is_overflow &&
401 api->PageActionWantsToRun(extension(), web_contents)); 402 api->PageActionWantsToRun(extension(), web_contents));
402 } 403 }
403 404
404 return image_source; 405 return image_source;
405 } 406 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698