| 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/ui/views/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/browser_actions_container.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 chevron_(NULL), | 68 chevron_(NULL), |
| 69 overflow_menu_(NULL), | 69 overflow_menu_(NULL), |
| 70 suppress_chevron_(false), | 70 suppress_chevron_(false), |
| 71 resize_amount_(0), | 71 resize_amount_(0), |
| 72 animation_target_size_(0), | 72 animation_target_size_(0), |
| 73 drop_indicator_position_(-1), | 73 drop_indicator_position_(-1), |
| 74 task_factory_(this), | 74 task_factory_(this), |
| 75 show_menu_task_factory_(this) { | 75 show_menu_task_factory_(this) { |
| 76 set_id(VIEW_ID_BROWSER_ACTION_TOOLBAR); | 76 set_id(VIEW_ID_BROWSER_ACTION_TOOLBAR); |
| 77 | 77 |
| 78 ExtensionService* service = | 78 model_ = ExtensionToolbarModel::Get(browser->profile()); |
| 79 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 79 if (model_) |
| 80 if (service) { | |
| 81 model_ = service->toolbar_model(); | |
| 82 model_->AddObserver(this); | 80 model_->AddObserver(this); |
| 83 } | |
| 84 | 81 |
| 85 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 82 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
| 86 browser->profile(), | 83 browser->profile(), |
| 87 owner_view->GetFocusManager(), | 84 owner_view->GetFocusManager(), |
| 88 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, | 85 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, |
| 89 this)); | 86 this)); |
| 90 | 87 |
| 91 resize_animation_.reset(new gfx::SlideAnimation(this)); | 88 resize_animation_.reset(new gfx::SlideAnimation(this)); |
| 92 resize_area_ = new views::ResizeArea(this); | 89 resize_area_ = new views::ResizeArea(this); |
| 93 AddChildView(resize_area_); | 90 AddChildView(resize_area_); |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 arrow, | 867 arrow, |
| 871 show_action); | 868 show_action); |
| 872 popup_->GetWidget()->AddObserver(this); | 869 popup_->GetWidget()->AddObserver(this); |
| 873 popup_button_ = button; | 870 popup_button_ = button; |
| 874 | 871 |
| 875 // Only set button as pushed if it was triggered by a user click. | 872 // Only set button as pushed if it was triggered by a user click. |
| 876 if (should_grant) | 873 if (should_grant) |
| 877 popup_button_->SetButtonPushed(); | 874 popup_button_->SetButtonPushed(); |
| 878 return true; | 875 return true; |
| 879 } | 876 } |
| OLD | NEW |