| OLD | NEW | 
|---|
| 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/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" | 
| 6 | 6 | 
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" | 
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" | 
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" | 
| 10 #include "chrome/browser/extensions/active_script_controller.h" | 10 #include "chrome/browser/extensions/active_script_controller.h" | 
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 249             ->OnClicked(extension); | 249             ->OnClicked(extension); | 
| 250       } | 250       } | 
| 251       break; | 251       break; | 
| 252     } | 252     } | 
| 253     case CONFIGURE: | 253     case CONFIGURE: | 
| 254       DCHECK(OptionsPageInfo::HasOptionsPage(extension)); | 254       DCHECK(OptionsPageInfo::HasOptionsPage(extension)); | 
| 255       ExtensionTabUtil::OpenOptionsPage(extension, browser_); | 255       ExtensionTabUtil::OpenOptionsPage(extension, browser_); | 
| 256       break; | 256       break; | 
| 257     case TOGGLE_VISIBILITY: { | 257     case TOGGLE_VISIBILITY: { | 
| 258       bool currently_visible = button_visibility_ == VISIBLE; | 258       bool currently_visible = button_visibility_ == VISIBLE; | 
|  | 259       // Without the toolbar redesign turned on, action visibility refers to | 
|  | 260       // any action presence in the toolbar, independent of whether the action | 
|  | 261       // is visible or overflowed. So any action present is considered visible. | 
|  | 262       if (!FeatureSwitch::extension_action_redesign()->IsEnabled()) | 
|  | 263         currently_visible = true; | 
| 259       ToolbarActionsModel::Get(browser_->profile()) | 264       ToolbarActionsModel::Get(browser_->profile()) | 
| 260           ->SetActionVisibility(extension->id(), !currently_visible); | 265           ->SetActionVisibility(extension->id(), !currently_visible); | 
| 261       break; | 266       break; | 
| 262     } | 267     } | 
| 263     case UNINSTALL: { | 268     case UNINSTALL: { | 
| 264       UninstallDialogHelper::UninstallExtension(browser_, extension); | 269       UninstallDialogHelper::UninstallExtension(browser_, extension); | 
| 265       break; | 270       break; | 
| 266     } | 271     } | 
| 267     case MANAGE: { | 272     case MANAGE: { | 
| 268       chrome::ShowExtensions(browser_, extension->id()); | 273       chrome::ShowExtensions(browser_, extension->id()); | 
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 367   extension_items_->AppendExtensionItems(MenuItem::ExtensionKey(extension_id_), | 372   extension_items_->AppendExtensionItems(MenuItem::ExtensionKey(extension_id_), | 
| 368                                          base::string16(), &index, | 373                                          base::string16(), &index, | 
| 369                                          true);  // is_action_menu | 374                                          true);  // is_action_menu | 
| 370 } | 375 } | 
| 371 | 376 | 
| 372 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { | 377 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { | 
| 373   return browser_->tab_strip_model()->GetActiveWebContents(); | 378   return browser_->tab_strip_model()->GetActiveWebContents(); | 
| 374 } | 379 } | 
| 375 | 380 | 
| 376 }  // namespace extensions | 381 }  // namespace extensions | 
| OLD | NEW | 
|---|