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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_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/toolbar_action_view.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder(); 201 scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder();
202 border->set_insets(gfx::Insets(kBorderInset, kBorderInset, 202 border->set_insets(gfx::Insets(kBorderInset, kBorderInset,
203 kBorderInset, kBorderInset)); 203 kBorderInset, kBorderInset));
204 return border.Pass(); 204 return border.Pass();
205 } 205 }
206 206
207 gfx::ImageSkia ToolbarActionView::GetIconForTest() { 207 gfx::ImageSkia ToolbarActionView::GetIconForTest() {
208 return GetImage(views::Button::STATE_NORMAL); 208 return GetImage(views::Button::STATE_NORMAL);
209 } 209 }
210 210
211 void ToolbarActionView::OnIconUpdated() {
212 UpdateState();
213 }
214
215 views::View* ToolbarActionView::GetAsView() { 211 views::View* ToolbarActionView::GetAsView() {
216 return this; 212 return this;
217 } 213 }
218 214
219 bool ToolbarActionView::IsShownInMenu() { 215 bool ToolbarActionView::IsShownInMenu() {
220 return delegate_->ShownInsideMenu(); 216 return delegate_->ShownInsideMenu();
221 } 217 }
222 218
223 views::FocusManager* ToolbarActionView::GetFocusManagerForAccelerator() { 219 views::FocusManager* ToolbarActionView::GetFocusManagerForAccelerator() {
224 return GetFocusManager(); 220 return GetFocusManager();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 271 }
276 272
277 void ToolbarActionView::CleanupPopup() { 273 void ToolbarActionView::CleanupPopup() {
278 // We need to do these actions synchronously (instead of closing and then 274 // We need to do these actions synchronously (instead of closing and then
279 // performing the rest of the cleanup in OnWidgetDestroyed()) because 275 // performing the rest of the cleanup in OnWidgetDestroyed()) because
280 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need 276 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need
281 // to keep the delegate's popup owner up-to-date. 277 // to keep the delegate's popup owner up-to-date.
282 delegate_->SetPopupOwner(NULL); 278 delegate_->SetPopupOwner(NULL);
283 pressed_lock_.reset(); // Unpress the menu button if it was pressed. 279 pressed_lock_.reset(); // Unpress the menu button if it was pressed.
284 } 280 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_action_view.h ('k') | chrome/browser/ui/views/toolbar/toolbar_action_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698