| 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/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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 MenuButton::ViewHierarchyChanged(details); | 96 MenuButton::ViewHierarchyChanged(details); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ToolbarActionView::OnDragDone() { | 99 void ToolbarActionView::OnDragDone() { |
| 100 views::MenuButton::OnDragDone(); | 100 views::MenuButton::OnDragDone(); |
| 101 delegate_->OnToolbarActionViewDragDone(); | 101 delegate_->OnToolbarActionViewDragDone(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 const char* ToolbarActionView::GetClassName() const { |
| 105 return "ToolbarActionView"; |
| 106 } |
| 107 |
| 104 gfx::Size ToolbarActionView::GetPreferredSize() const { | 108 gfx::Size ToolbarActionView::GetPreferredSize() const { |
| 105 return gfx::Size(ToolbarActionsBar::IconWidth(false), | 109 return gfx::Size(ToolbarActionsBar::IconWidth(false), |
| 106 ToolbarActionsBar::IconHeight()); | 110 ToolbarActionsBar::IconHeight()); |
| 107 } | 111 } |
| 108 | 112 |
| 109 void ToolbarActionView::PaintChildren(gfx::Canvas* canvas, | 113 void ToolbarActionView::PaintChildren(gfx::Canvas* canvas, |
| 110 const views::CullSet& cull_set) { | 114 const views::CullSet& cull_set) { |
| 111 View::PaintChildren(canvas, cull_set); | 115 View::PaintChildren(canvas, cull_set); |
| 112 view_controller_->PaintExtra( | 116 view_controller_->PaintExtra( |
| 113 canvas, GetLocalBounds(), GetCurrentWebContents()); | 117 canvas, GetLocalBounds(), GetCurrentWebContents()); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 300 } |
| 297 | 301 |
| 298 void ToolbarActionView::CleanupPopup() { | 302 void ToolbarActionView::CleanupPopup() { |
| 299 // We need to do these actions synchronously (instead of closing and then | 303 // We need to do these actions synchronously (instead of closing and then |
| 300 // performing the rest of the cleanup in OnWidgetDestroyed()) because | 304 // performing the rest of the cleanup in OnWidgetDestroyed()) because |
| 301 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need | 305 // OnWidgetDestroyed() can be called asynchronously from Close(), and we need |
| 302 // to keep the delegate's popup owner up-to-date. | 306 // to keep the delegate's popup owner up-to-date. |
| 303 delegate_->SetPopupOwner(NULL); | 307 delegate_->SetPopupOwner(NULL); |
| 304 pressed_lock_.reset(); // Unpress the menu button if it was pressed. | 308 pressed_lock_.reset(); // Unpress the menu button if it was pressed. |
| 305 } | 309 } |
| OLD | NEW |