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/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" |
13 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
14 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
17 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
18 #include "base/string_util.h" | 19 #include "base/string_util.h" |
19 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
20 #include "chrome/app/chrome_command_ids.h" | 21 #include "chrome/app/chrome_command_ids.h" |
21 #include "chrome/browser/accessibility/accessibility_events.h" | 22 #include "chrome/browser/accessibility/accessibility_events.h" |
22 #include "chrome/browser/alternate_nav_url_fetcher.h" | 23 #include "chrome/browser/alternate_nav_url_fetcher.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 ui::TEXT_PLAIN | | 696 ui::TEXT_PLAIN | |
696 ui::TEXT_URI_LIST | | 697 ui::TEXT_URI_LIST | |
697 ui::CHROME_NAMED_URL); | 698 ui::CHROME_NAMED_URL); |
698 } | 699 } |
699 | 700 |
700 WebContents* LocationBarViewGtk::GetWebContents() const { | 701 WebContents* LocationBarViewGtk::GetWebContents() const { |
701 return chrome::GetActiveWebContents(browser_); | 702 return chrome::GetActiveWebContents(browser_); |
702 } | 703 } |
703 | 704 |
704 void LocationBarViewGtk::SetPreviewEnabledPageAction( | 705 void LocationBarViewGtk::SetPreviewEnabledPageAction( |
705 ExtensionAction *page_action, | 706 ExtensionAction* page_action, |
706 bool preview_enabled) { | 707 bool preview_enabled) { |
707 DCHECK(page_action); | 708 DCHECK(page_action); |
708 for (ScopedVector<PageActionViewGtk>::iterator iter = | 709 for (ScopedVector<PageActionViewGtk>::iterator iter = |
709 page_action_views_.begin(); iter != page_action_views_.end(); | 710 page_action_views_.begin(); iter != page_action_views_.end(); |
710 ++iter) { | 711 ++iter) { |
711 if ((*iter)->page_action() == page_action) { | 712 if ((*iter)->page_action() == page_action) { |
712 (*iter)->set_preview_enabled(preview_enabled); | 713 (*iter)->set_preview_enabled(preview_enabled); |
713 UpdatePageActions(); | 714 UpdatePageActions(); |
714 return; | 715 return; |
715 } | 716 } |
716 } | 717 } |
717 } | 718 } |
718 | 719 |
719 GtkWidget* LocationBarViewGtk::GetPageActionWidget( | 720 GtkWidget* LocationBarViewGtk::GetPageActionWidget( |
720 ExtensionAction *page_action) { | 721 ExtensionAction* page_action) { |
721 DCHECK(page_action); | 722 DCHECK(page_action); |
722 for (ScopedVector<PageActionViewGtk>::iterator iter = | 723 for (ScopedVector<PageActionViewGtk>::iterator iter = |
723 page_action_views_.begin(); | 724 page_action_views_.begin(); |
724 iter != page_action_views_.end(); | 725 iter != page_action_views_.end(); |
725 ++iter) { | 726 ++iter) { |
726 if ((*iter)->page_action() == page_action) | 727 if ((*iter)->page_action() == page_action) |
727 return (*iter)->widget(); | 728 return (*iter)->widget(); |
728 } | 729 } |
729 return NULL; | 730 return NULL; |
730 } | 731 } |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 } | 2138 } |
2138 | 2139 |
2139 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2140 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2140 ExtensionAction* action) { | 2141 ExtensionAction* action) { |
2141 ExtensionPopupGtk::Show( | 2142 ExtensionPopupGtk::Show( |
2142 action->GetPopupUrl(current_tab_id_), | 2143 action->GetPopupUrl(current_tab_id_), |
2143 owner_->browser_, | 2144 owner_->browser_, |
2144 event_box_.get(), | 2145 event_box_.get(), |
2145 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2146 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2146 } | 2147 } |
OLD | NEW |