| 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/home_button.h" | 5 #include "chrome/browser/ui/views/toolbar/home_button.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" | 10 #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // called twice. | 129 // called twice. |
| 130 DCHECK_EQ(this, home_page_undo_bubble_); | 130 DCHECK_EQ(this, home_page_undo_bubble_); |
| 131 home_page_undo_bubble_ = NULL; | 131 home_page_undo_bubble_ = NULL; |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace | 134 } // namespace |
| 135 | 135 |
| 136 | 136 |
| 137 // HomeButton ----------------------------------------------------------- | 137 // HomeButton ----------------------------------------------------------- |
| 138 | 138 |
| 139 HomeButton::HomeButton( | 139 HomeButton::HomeButton(views::ButtonListener* listener, Browser* browser) |
| 140 views::ButtonListener* listener, | 140 : ToolbarButton(browser->profile(), listener, nullptr), browser_(browser) {} |
| 141 Browser* browser) | |
| 142 : ToolbarButton(listener, NULL), | |
| 143 browser_(browser) { | |
| 144 } | |
| 145 | 141 |
| 146 HomeButton::~HomeButton() { | 142 HomeButton::~HomeButton() { |
| 147 } | 143 } |
| 148 | 144 |
| 149 const char* HomeButton::GetClassName() const { | 145 const char* HomeButton::GetClassName() const { |
| 150 return "HomeButton"; | 146 return "HomeButton"; |
| 151 } | 147 } |
| 152 | 148 |
| 153 bool HomeButton::GetDropFormats( | 149 bool HomeButton::GetDropFormats( |
| 154 int* formats, | 150 int* formats, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 181 | 177 |
| 182 HomePageUndoBubble::ShowBubble(browser_, old_is_ntp, old_homepage, this); | 178 HomePageUndoBubble::ShowBubble(browser_, old_is_ntp, old_homepage, this); |
| 183 } | 179 } |
| 184 return ui::DragDropTypes::DRAG_NONE; | 180 return ui::DragDropTypes::DRAG_NONE; |
| 185 } | 181 } |
| 186 | 182 |
| 187 void HomeButton::NotifyClick(const ui::Event& event) { | 183 void HomeButton::NotifyClick(const ui::Event& event) { |
| 188 ToolbarButton::NotifyClick(event); | 184 ToolbarButton::NotifyClick(event); |
| 189 extensions::MaybeShowExtensionControlledHomeNotification(browser_); | 185 extensions::MaybeShowExtensionControlledHomeNotification(browser_); |
| 190 } | 186 } |
| OLD | NEW |