OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return; | 257 return; |
258 | 258 |
259 gtk_label_set_text(GTK_LABEL(label_.get()), | 259 gtk_label_set_text(GTK_LABEL(label_.get()), |
260 l10n_util::GetStringUTF8(label_string_id).c_str()); | 260 l10n_util::GetStringUTF8(label_string_id).c_str()); |
261 StartAnimating(); | 261 StartAnimating(); |
262 } | 262 } |
263 | 263 |
264 void ContentSettingImageViewGtk::AnimationEnded( | 264 void ContentSettingImageViewGtk::AnimationEnded( |
265 const ui::Animation* animation) { | 265 const ui::Animation* animation) { |
266 if (animation_.IsShowing()) { | 266 if (animation_.IsShowing()) { |
267 MessageLoop::current()->PostDelayedTask( | 267 base::MessageLoop::current()->PostDelayedTask( |
268 FROM_HERE, | 268 FROM_HERE, |
269 base::Bind(&ContentSettingImageViewGtk::CloseAnimation, | 269 base::Bind(&ContentSettingImageViewGtk::CloseAnimation, |
270 weak_factory_.GetWeakPtr()), | 270 weak_factory_.GetWeakPtr()), |
271 base::TimeDelta::FromMilliseconds(kContentSettingImageDisplayTime)); | 271 base::TimeDelta::FromMilliseconds(kContentSettingImageDisplayTime)); |
272 } else { | 272 } else { |
273 gtk_widget_hide(label_.get()); | 273 gtk_widget_hide(label_.get()); |
274 gtk_util::StopActingAsRoundedWindow(event_box_.get()); | 274 gtk_util::StopActingAsRoundedWindow(event_box_.get()); |
275 gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box_.get()), FALSE); | 275 gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box_.get()), FALSE); |
276 } | 276 } |
277 } | 277 } |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 } | 834 } |
835 | 835 |
836 InstantController* LocationBarViewGtk::GetInstant() { | 836 InstantController* LocationBarViewGtk::GetInstant() { |
837 return browser_->instant_controller() ? | 837 return browser_->instant_controller() ? |
838 browser_->instant_controller()->instant() : NULL; | 838 browser_->instant_controller()->instant() : NULL; |
839 } | 839 } |
840 | 840 |
841 void LocationBarViewGtk::ShowFirstRunBubble() { | 841 void LocationBarViewGtk::ShowFirstRunBubble() { |
842 // We need the browser window to be shown before we can show the bubble, but | 842 // We need the browser window to be shown before we can show the bubble, but |
843 // we get called before that's happened. | 843 // we get called before that's happened. |
844 MessageLoop::current()->PostTask( | 844 base::MessageLoop::current()->PostTask( |
845 FROM_HERE, | 845 FROM_HERE, |
846 base::Bind(&LocationBarViewGtk::ShowFirstRunBubbleInternal, | 846 base::Bind(&LocationBarViewGtk::ShowFirstRunBubbleInternal, |
847 weak_ptr_factory_.GetWeakPtr())); | 847 weak_ptr_factory_.GetWeakPtr())); |
848 } | 848 } |
849 | 849 |
850 void LocationBarViewGtk::SetInstantSuggestion( | 850 void LocationBarViewGtk::SetInstantSuggestion( |
851 const InstantSuggestion& suggestion) { | 851 const InstantSuggestion& suggestion) { |
852 location_entry_->model()->SetInstantSuggestion(suggestion); | 852 location_entry_->model()->SetInstantSuggestion(suggestion); |
853 } | 853 } |
854 | 854 |
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 } | 2100 } |
2101 | 2101 |
2102 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2102 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2103 ExtensionAction* action) { | 2103 ExtensionAction* action) { |
2104 ExtensionPopupGtk::Show( | 2104 ExtensionPopupGtk::Show( |
2105 action->GetPopupUrl(current_tab_id_), | 2105 action->GetPopupUrl(current_tab_id_), |
2106 owner_->browser_, | 2106 owner_->browser_, |
2107 event_box_.get(), | 2107 event_box_.get(), |
2108 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2108 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2109 } | 2109 } |
OLD | NEW |