| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gtk/browser_actions_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 25 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 26 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" | 26 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" |
| 27 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" | 27 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" |
| 28 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" | 28 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" |
| 29 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 29 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 30 #include "chrome/browser/ui/gtk/gtk_util.h" | 30 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 31 #include "chrome/browser/ui/gtk/hover_controller_gtk.h" | 31 #include "chrome/browser/ui/gtk/hover_controller_gtk.h" |
| 32 #include "chrome/browser/ui/gtk/menu_gtk.h" | 32 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 33 #include "chrome/browser/ui/gtk/view_id_util.h" | 33 #include "chrome/browser/ui/gtk/view_id_util.h" |
| 34 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 34 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 35 #include "chrome/common/chrome_notification_types.h" | 35 #include "chrome/common/chrome_notification_types.h" |
| 36 #include "chrome/common/extensions/extension.h" | 36 #include "chrome/common/extensions/extension.h" |
| 37 #include "chrome/common/extensions/extension_action.h" | 37 #include "chrome/common/extensions/extension_action.h" |
| 38 #include "chrome/common/extensions/extension_manifest_constants.h" | 38 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 39 #include "chrome/common/extensions/extension_resource.h" | 39 #include "chrome/common/extensions/extension_resource.h" |
| 40 #include "content/public/browser/notification_details.h" | 40 #include "content/public/browser/notification_details.h" |
| 41 #include "content/public/browser/notification_source.h" | 41 #include "content/public/browser/notification_source.h" |
| 42 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
| 43 #include "grit/theme_resources_standard.h" | 43 #include "grit/theme_resources_standard.h" |
| 44 #include "grit/ui_resources.h" | 44 #include "grit/ui_resources.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 } | 557 } |
| 558 | 558 |
| 559 BrowserActionsToolbarGtk::~BrowserActionsToolbarGtk() { | 559 BrowserActionsToolbarGtk::~BrowserActionsToolbarGtk() { |
| 560 if (model_) | 560 if (model_) |
| 561 model_->RemoveObserver(this); | 561 model_->RemoveObserver(this); |
| 562 button_hbox_.Destroy(); | 562 button_hbox_.Destroy(); |
| 563 hbox_.Destroy(); | 563 hbox_.Destroy(); |
| 564 } | 564 } |
| 565 | 565 |
| 566 int BrowserActionsToolbarGtk::GetCurrentTabId() { | 566 int BrowserActionsToolbarGtk::GetCurrentTabId() { |
| 567 TabContentsWrapper* selected_tab = browser_->GetSelectedTabContentsWrapper(); | 567 TabContents* active_tab = browser_->GetActiveTabContents(); |
| 568 if (!selected_tab) | 568 if (!active_tab) |
| 569 return -1; | 569 return -1; |
| 570 | 570 |
| 571 return selected_tab->restore_tab_helper()->session_id().id(); | 571 return active_tab->restore_tab_helper()->session_id().id(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 void BrowserActionsToolbarGtk::Update() { | 574 void BrowserActionsToolbarGtk::Update() { |
| 575 for (ExtensionButtonMap::iterator iter = extension_button_map_.begin(); | 575 for (ExtensionButtonMap::iterator iter = extension_button_map_.begin(); |
| 576 iter != extension_button_map_.end(); ++iter) { | 576 iter != extension_button_map_.end(); ++iter) { |
| 577 iter->second->UpdateState(); | 577 iter->second->UpdateState(); |
| 578 } | 578 } |
| 579 } | 579 } |
| 580 | 580 |
| 581 void BrowserActionsToolbarGtk::Observe( | 581 void BrowserActionsToolbarGtk::Observe( |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 | 1064 |
| 1065 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 1065 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
| 1066 event->time); | 1066 event->time); |
| 1067 return TRUE; | 1067 return TRUE; |
| 1068 } | 1068 } |
| 1069 | 1069 |
| 1070 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 1070 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
| 1071 if (!resize_animation_.is_animating()) | 1071 if (!resize_animation_.is_animating()) |
| 1072 UpdateChevronVisibility(); | 1072 UpdateChevronVisibility(); |
| 1073 } | 1073 } |
| OLD | NEW |