Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 6125003: Make ExtensionBrowserEventRouter owned by ExtensionService.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gtk/location_bar_view_gtk.h" 5 #include "chrome/browser/gtk/location_bar_view_gtk.h"
6 6
7 #include <algorithm>
7 #include <string> 8 #include <string>
9 #include <vector>
8 10
9 #include "app/gtk_dnd_util.h" 11 #include "app/gtk_dnd_util.h"
10 #include "app/l10n_util.h" 12 #include "app/l10n_util.h"
11 #include "app/resource_bundle.h" 13 #include "app/resource_bundle.h"
12 #include "base/basictypes.h" 14 #include "base/basictypes.h"
13 #include "base/command_line.h" 15 #include "base/command_line.h"
14 #include "base/i18n/rtl.h" 16 #include "base/i18n/rtl.h"
15 #include "base/logging.h" 17 #include "base/logging.h"
16 #include "base/string_util.h" 18 #include "base/string_util.h"
17 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 event_box_.get(), 1509 event_box_.get(),
1508 devtools); 1510 devtools);
1509 return true; 1511 return true;
1510 } 1512 }
1511 1513
1512 gboolean LocationBarViewGtk::PageActionViewGtk::OnButtonPressed( 1514 gboolean LocationBarViewGtk::PageActionViewGtk::OnButtonPressed(
1513 GtkWidget* sender, 1515 GtkWidget* sender,
1514 GdkEvent* event) { 1516 GdkEvent* event) {
1515 if (event->button.button != 3) { 1517 if (event->button.button != 3) {
1516 if (!ShowPopup(false)) { 1518 if (!ShowPopup(false)) {
1517 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( 1519 ExtensionService* service = profile_->GetExtensionService();
1520 service->browser_event_router()->PageActionExecuted(
1518 profile_, 1521 profile_,
1519 page_action_->extension_id(), 1522 page_action_->extension_id(),
1520 page_action_->id(), 1523 page_action_->id(),
1521 current_tab_id_, 1524 current_tab_id_,
1522 current_url_.spec(), 1525 current_url_.spec(),
1523 event->button.button); 1526 event->button.button);
1524 } 1527 }
1525 } else { 1528 } else {
1526 const Extension* extension = profile_->GetExtensionService()-> 1529 const Extension* extension = profile_->GetExtensionService()->
1527 GetExtensionById(page_action()->extension_id(), false); 1530 GetExtensionById(page_action()->extension_id(), false);
(...skipping 20 matching lines...) Expand all
1548 1551
1549 std::string badge_text = page_action_->GetBadgeText(tab_id); 1552 std::string badge_text = page_action_->GetBadgeText(tab_id);
1550 if (badge_text.empty()) 1553 if (badge_text.empty())
1551 return FALSE; 1554 return FALSE;
1552 1555
1553 gfx::CanvasSkiaPaint canvas(event, false); 1556 gfx::CanvasSkiaPaint canvas(event, false);
1554 gfx::Rect bounding_rect(widget->allocation); 1557 gfx::Rect bounding_rect(widget->allocation);
1555 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); 1558 page_action_->PaintBadge(&canvas, bounding_rect, tab_id);
1556 return FALSE; 1559 return FALSE;
1557 } 1560 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc ('k') | chrome/browser/ui/views/browser_actions_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698