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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 10911105: Switch ScriptBadgeController and PageActionController to use WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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) 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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 if (content::Details<WebContents>(contents) != details) 553 if (content::Details<WebContents>(contents) != details)
554 return; 554 return;
555 555
556 [field_ updateCursorAndToolTipRects]; 556 [field_ updateCursorAndToolTipRects];
557 [field_ setNeedsDisplay:YES]; 557 [field_ setNeedsDisplay:YES];
558 break; 558 break;
559 } 559 }
560 560
561 case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: { 561 case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: {
562 // Only update if the updated action box was for the active tab contents. 562 // Only update if the updated action box was for the active tab contents.
563 TabContents* target_tab = content::Details<TabContents>(details).ptr(); 563 WebContents* target_tab = content::Details<WebContents>(details).ptr();
564 if (target_tab == GetTabContents()) 564 if (target_tab == GetTabContents()->web_contents())
565 UpdatePageActions(); 565 UpdatePageActions();
566 break; 566 break;
567 } 567 }
568 568
569 case chrome::NOTIFICATION_PREF_CHANGED: 569 case chrome::NOTIFICATION_PREF_CHANGED:
570 UpdateStarDecorationVisibility(); 570 UpdateStarDecorationVisibility();
571 UpdateChromeToMobileEnabled(); 571 UpdateChromeToMobileEnabled();
572 OnChanged(); 572 OnChanged();
573 break; 573 break;
574 574
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 742
743 void LocationBarViewMac::UpdateStarDecorationVisibility() { 743 void LocationBarViewMac::UpdateStarDecorationVisibility() {
744 bool action_box_enabled = 744 bool action_box_enabled =
745 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox); 745 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableActionBox);
746 // If the action box is enabled, only show the star if it's lit. 746 // If the action box is enabled, only show the star if it's lit.
747 bool visible = IsStarEnabled(); 747 bool visible = IsStarEnabled();
748 if (!star_decoration_->starred() && action_box_enabled) 748 if (!star_decoration_->starred() && action_box_enabled)
749 visible = false; 749 visible = false;
750 star_decoration_->SetVisible(visible); 750 star_decoration_->SetVisible(visible);
751 } 751 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698