| 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 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 private: | 333 private: |
| 334 // PageToolViewGtk | 334 // PageToolViewGtk |
| 335 virtual GdkColor button_border_color() const OVERRIDE; | 335 virtual GdkColor button_border_color() const OVERRIDE; |
| 336 virtual GdkColor gradient_top_color() const OVERRIDE; | 336 virtual GdkColor gradient_top_color() const OVERRIDE; |
| 337 virtual GdkColor gradient_bottom_color() const OVERRIDE; | 337 virtual GdkColor gradient_bottom_color() const OVERRIDE; |
| 338 virtual void OnClick(GtkWidget* sender) OVERRIDE; | 338 virtual void OnClick(GtkWidget* sender) OVERRIDE; |
| 339 | 339 |
| 340 DISALLOW_COPY_AND_ASSIGN(WebIntentsButtonViewGtk); | 340 DISALLOW_COPY_AND_ASSIGN(WebIntentsButtonViewGtk); |
| 341 }; | 341 }; |
| 342 | 342 |
| 343 void WebIntentsButtonViewGtk::Update( | 343 void WebIntentsButtonViewGtk::Update(TabContents* tab_contents) { |
| 344 TabContents* tab_contents) { | 344 WebIntentPickerController* web_intent_picker_controller = |
| 345 if (!tab_contents || | 345 tab_contents ? WebIntentPickerController::FromWebContents( |
| 346 !tab_contents->web_intent_picker_controller() || | 346 tab_contents->web_contents()) |
| 347 !tab_contents->web_intent_picker_controller()-> | 347 : NULL; |
| 348 ShowLocationBarPickerTool()) { | 348 if (!web_intent_picker_controller || |
| 349 !web_intent_picker_controller->ShowLocationBarPickerTool()) { |
| 349 gtk_widget_hide(widget()); | 350 gtk_widget_hide(widget()); |
| 350 return; | 351 return; |
| 351 } | 352 } |
| 352 | 353 |
| 353 gtk_widget_set_tooltip_text(widget(), | 354 gtk_widget_set_tooltip_text(widget(), |
| 354 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_USE_ANOTHER_SERVICE).c_str()); | 355 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_USE_ANOTHER_SERVICE).c_str()); |
| 355 gtk_widget_show_all(widget()); | 356 gtk_widget_show_all(widget()); |
| 356 | 357 |
| 357 gtk_label_set_text(GTK_LABEL(label_.get()), | 358 gtk_label_set_text(GTK_LABEL(label_.get()), |
| 358 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_USE_ANOTHER_SERVICE).c_str()); | 359 l10n_util::GetStringUTF8(IDS_INTENT_PICKER_USE_ANOTHER_SERVICE).c_str()); |
| 359 | 360 |
| 360 StartAnimating(); | 361 StartAnimating(); |
| 361 } | 362 } |
| 362 | 363 |
| 363 void WebIntentsButtonViewGtk::OnClick(GtkWidget* sender) { | 364 void WebIntentsButtonViewGtk::OnClick(GtkWidget* sender) { |
| 364 TabContents* tab_contents = parent_->GetTabContents(); | 365 TabContents* tab_contents = parent_->GetTabContents(); |
| 365 if (!tab_contents) | 366 if (!tab_contents) |
| 366 return; | 367 return; |
| 367 | 368 |
| 368 tab_contents->web_intent_picker_controller()->LocationBarPickerToolClicked(); | 369 WebIntentPickerController::FromWebContents(tab_contents->web_contents())-> |
| 370 LocationBarPickerToolClicked(); |
| 369 } | 371 } |
| 370 | 372 |
| 371 GdkColor WebIntentsButtonViewGtk::button_border_color() const { | 373 GdkColor WebIntentsButtonViewGtk::button_border_color() const { |
| 372 return kGrayBorderColor; | 374 return kGrayBorderColor; |
| 373 } | 375 } |
| 374 | 376 |
| 375 GdkColor WebIntentsButtonViewGtk::gradient_top_color() const { | 377 GdkColor WebIntentsButtonViewGtk::gradient_top_color() const { |
| 376 return kTopColorGray; | 378 return kTopColorGray; |
| 377 } | 379 } |
| 378 | 380 |
| (...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 } | 2138 } |
| 2137 | 2139 |
| 2138 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2140 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2139 ExtensionAction* action) { | 2141 ExtensionAction* action) { |
| 2140 ExtensionPopupGtk::Show( | 2142 ExtensionPopupGtk::Show( |
| 2141 action->GetPopupUrl(current_tab_id_), | 2143 action->GetPopupUrl(current_tab_id_), |
| 2142 owner_->browser_, | 2144 owner_->browser_, |
| 2143 event_box_.get(), | 2145 event_box_.get(), |
| 2144 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2146 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2145 } | 2147 } |
| OLD | NEW |