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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_action_view.cc

Issue 670463004: Make a platform-independent ToolbarActionViewController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder(); 200 scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder();
201 border->set_insets(gfx::Insets(kBorderInset, kBorderInset, 201 border->set_insets(gfx::Insets(kBorderInset, kBorderInset,
202 kBorderInset, kBorderInset)); 202 kBorderInset, kBorderInset));
203 return border.Pass(); 203 return border.Pass();
204 } 204 }
205 205
206 gfx::ImageSkia BrowserActionView::GetIconForTest() { 206 gfx::ImageSkia BrowserActionView::GetIconForTest() {
207 return GetImage(views::Button::STATE_NORMAL); 207 return GetImage(views::Button::STATE_NORMAL);
208 } 208 }
209 209
210 void BrowserActionView::OnIconUpdated() {
211 UpdateState();
212 }
213
214 views::View* BrowserActionView::GetAsView() { 210 views::View* BrowserActionView::GetAsView() {
215 return this; 211 return this;
216 } 212 }
217 213
218 bool BrowserActionView::IsShownInMenu() { 214 bool BrowserActionView::IsShownInMenu() {
219 return delegate_->ShownInsideMenu(); 215 return delegate_->ShownInsideMenu();
220 } 216 }
221 217
222 views::FocusManager* BrowserActionView::GetFocusManagerForAccelerator() { 218 views::FocusManager* BrowserActionView::GetFocusManagerForAccelerator() {
223 return GetFocusManager(); 219 return GetFocusManager();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 270 }
275 271
276 void BrowserActionView::CleanupPopup() { 272 void BrowserActionView::CleanupPopup() {
277 // We need to do these actions synchronously (instead of closing and then 273 // We need to do these actions synchronously (instead of closing and then
278 // performing the rest of the cleanup in OnWidgetDestroyed()) because 274 // performing the rest of the cleanup in OnWidgetDestroyed()) because
279 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need 275 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need
280 // to keep the delegate's popup owner up-to-date. 276 // to keep the delegate's popup owner up-to-date.
281 delegate_->SetPopupOwner(NULL); 277 delegate_->SetPopupOwner(NULL);
282 pressed_lock_.reset(); // Unpress the menu button if it was pressed. 278 pressed_lock_.reset(); // Unpress the menu button if it was pressed.
283 } 279 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698