| 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 "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/profiles/profile.h" | |
| 12 #include "chrome/browser/sessions/session_tab_helper.h" | 11 #include "chrome/browser/sessions/session_tab_helper.h" |
| 13 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" | 12 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" |
| 14 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" | 13 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" |
| 15 #include "chrome/browser/ui/view_ids.h" | 14 #include "chrome/browser/ui/view_ids.h" |
| 16 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 17 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 18 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
| 19 #include "ui/accessibility/ax_view_state.h" | 18 #include "ui/accessibility/ax_view_state.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
| 21 #include "ui/compositor/paint_recorder.h" | 20 #include "ui/compositor/paint_recorder.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 // The callback to call directly before showing the context menu. | 48 // The callback to call directly before showing the context menu. |
| 50 ToolbarActionView::ContextMenuCallback* context_menu_callback = nullptr; | 49 ToolbarActionView::ContextMenuCallback* context_menu_callback = nullptr; |
| 51 | 50 |
| 52 } // namespace | 51 } // namespace |
| 53 | 52 |
| 54 //////////////////////////////////////////////////////////////////////////////// | 53 //////////////////////////////////////////////////////////////////////////////// |
| 55 // ToolbarActionView | 54 // ToolbarActionView |
| 56 | 55 |
| 57 ToolbarActionView::ToolbarActionView( | 56 ToolbarActionView::ToolbarActionView( |
| 58 ToolbarActionViewController* view_controller, | 57 ToolbarActionViewController* view_controller, |
| 59 Profile* profile, | |
| 60 ToolbarActionView::Delegate* delegate) | 58 ToolbarActionView::Delegate* delegate) |
| 61 : MenuButton(nullptr, base::string16(), this, false), | 59 : MenuButton(nullptr, base::string16(), this, false), |
| 62 view_controller_(view_controller), | 60 view_controller_(view_controller), |
| 63 profile_(profile), | |
| 64 delegate_(delegate), | 61 delegate_(delegate), |
| 65 called_register_command_(false), | 62 called_register_command_(false), |
| 66 wants_to_run_(false), | 63 wants_to_run_(false), |
| 67 menu_(nullptr), | 64 menu_(nullptr), |
| 68 ink_drop_delegate_(new views::ButtonInkDropDelegate(this, this)), | 65 ink_drop_delegate_(new views::ButtonInkDropDelegate(this, this)), |
| 69 weak_factory_(this) { | 66 weak_factory_(this) { |
| 70 set_ink_drop_delegate(ink_drop_delegate_.get()); | 67 set_ink_drop_delegate(ink_drop_delegate_.get()); |
| 71 set_has_ink_drop_action_on_click(true); | 68 set_has_ink_drop_action_on_click(true); |
| 72 set_id(VIEW_ID_BROWSER_ACTION); | 69 set_id(VIEW_ID_BROWSER_ACTION); |
| 73 view_controller_->SetDelegate(this); | 70 view_controller_->SetDelegate(this); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 if (menu_controller->in_nested_run()) { | 358 if (menu_controller->in_nested_run()) { |
| 362 // There is another menu showing. Close the outermost menu (since we are | 359 // There is another menu showing. Close the outermost menu (since we are |
| 363 // shown in the same menu, we don't want to close the whole thing). | 360 // shown in the same menu, we don't want to close the whole thing). |
| 364 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); | 361 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); |
| 365 return true; | 362 return true; |
| 366 } | 363 } |
| 367 } | 364 } |
| 368 | 365 |
| 369 return false; | 366 return false; |
| 370 } | 367 } |
| OLD | NEW |