| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/browser_action_view.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_action_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/api/commands/command_service.h" | 9 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" | 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 : MenuButton(this, base::string16(), NULL, false), | 116 : MenuButton(this, base::string16(), NULL, false), |
| 117 browser_(browser), | 117 browser_(browser), |
| 118 browser_action_( | 118 browser_action_( |
| 119 extensions::ExtensionActionManager::Get(browser->profile())-> | 119 extensions::ExtensionActionManager::Get(browser->profile())-> |
| 120 GetBrowserAction(*extension)), | 120 GetBrowserAction(*extension)), |
| 121 extension_(extension), | 121 extension_(extension), |
| 122 icon_factory_(browser->profile(), extension, browser_action_, this), | 122 icon_factory_(browser->profile(), extension, browser_action_, this), |
| 123 delegate_(delegate), | 123 delegate_(delegate), |
| 124 context_menu_(NULL), | 124 context_menu_(NULL), |
| 125 called_registered_extension_command_(false) { | 125 called_registered_extension_command_(false) { |
| 126 set_border(NULL); | 126 SetBorder(views::Border::NullBorder()); |
| 127 set_alignment(TextButton::ALIGN_CENTER); | 127 set_alignment(TextButton::ALIGN_CENTER); |
| 128 set_context_menu_controller(this); | 128 set_context_menu_controller(this); |
| 129 | 129 |
| 130 // No UpdateState() here because View hierarchy not setup yet. Our parent | 130 // No UpdateState() here because View hierarchy not setup yet. Our parent |
| 131 // should call UpdateState() after creation. | 131 // should call UpdateState() after creation. |
| 132 | 132 |
| 133 content::NotificationSource notification_source = | 133 content::NotificationSource notification_source = |
| 134 content::Source<Profile>(browser_->profile()->GetOriginalProfile()); | 134 content::Source<Profile>(browser_->profile()->GetOriginalProfile()); |
| 135 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, | 135 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED, |
| 136 content::Source<ExtensionAction>(browser_action_)); | 136 content::Source<ExtensionAction>(browser_action_)); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 extensions::Command browser_action_command; | 426 extensions::Command browser_action_command; |
| 427 if (!only_if_active || !command_service->GetBrowserActionCommand( | 427 if (!only_if_active || !command_service->GetBrowserActionCommand( |
| 428 extension_->id(), | 428 extension_->id(), |
| 429 extensions::CommandService::ACTIVE_ONLY, | 429 extensions::CommandService::ACTIVE_ONLY, |
| 430 &browser_action_command, | 430 &browser_action_command, |
| 431 NULL)) { | 431 NULL)) { |
| 432 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); | 432 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); |
| 433 keybinding_.reset(NULL); | 433 keybinding_.reset(NULL); |
| 434 } | 434 } |
| 435 } | 435 } |
| OLD | NEW |