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

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

Issue 561023002: Use the wrench menu as a reference view for overflowed extension actions' popups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master for CQ Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_action_view_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extensions/extension_action_view_controller.h" 5 #include "chrome/browser/ui/views/extensions/extension_action_view_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/extensions/api/commands/command_service.h" 8 #include "chrome/browser/extensions/api/commands/command_service.h"
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
10 #include "chrome/browser/extensions/extension_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void ExtensionActionViewController::ExecuteActionByUser() { 65 void ExtensionActionViewController::ExecuteActionByUser() {
66 ExecuteAction(ExtensionPopup::SHOW, true); 66 ExecuteAction(ExtensionPopup::SHOW, true);
67 } 67 }
68 68
69 bool ExtensionActionViewController::ExecuteAction( 69 bool ExtensionActionViewController::ExecuteAction(
70 ExtensionPopup::ShowAction show_action, bool grant_tab_permissions) { 70 ExtensionPopup::ShowAction show_action, bool grant_tab_permissions) {
71 if (extensions::ExtensionActionAPI::Get(browser_->profile())-> 71 if (extensions::ExtensionActionAPI::Get(browser_->profile())->
72 ExecuteExtensionAction(extension_, browser_, grant_tab_permissions) == 72 ExecuteExtensionAction(extension_, browser_, grant_tab_permissions) ==
73 ExtensionAction::ACTION_SHOW_POPUP) { 73 ExtensionAction::ACTION_SHOW_POPUP) {
74 GURL popup_url = extension_action_->GetPopupUrl(GetCurrentTabId()); 74 GURL popup_url = extension_action_->GetPopupUrl(GetCurrentTabId());
75 if (ShowPopupWithUrl(show_action, popup_url)) { 75 if (delegate_->GetPreferredPopupViewController()->ShowPopupWithUrl(
76 show_action, popup_url)) {
76 delegate_->OnPopupShown(grant_tab_permissions); 77 delegate_->OnPopupShown(grant_tab_permissions);
77 return true; 78 return true;
78 } 79 }
79 } 80 }
80 return false; 81 return false;
81 } 82 }
82 83
83 void ExtensionActionViewController::HidePopup() { 84 void ExtensionActionViewController::HidePopup() {
84 if (popup_) 85 if (popup_)
85 CleanupPopup(true); 86 CleanupPopup(true);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 306 }
306 307
307 void ExtensionActionViewController::CleanupPopup(bool close_widget) { 308 void ExtensionActionViewController::CleanupPopup(bool close_widget) {
308 DCHECK(popup_); 309 DCHECK(popup_);
309 delegate_->CleanupPopup(); 310 delegate_->CleanupPopup();
310 popup_->GetWidget()->RemoveObserver(this); 311 popup_->GetWidget()->RemoveObserver(this);
311 if (close_widget) 312 if (close_widget)
312 popup_->GetWidget()->Close(); 313 popup_->GetWidget()->Close();
313 popup_ = NULL; 314 popup_ = NULL;
314 } 315 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/extensions/extension_action_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698