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

Side by Side Diff: chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only 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 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_ api.h" 5 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_ api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_ api_constants.h" 10 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_ api_constants.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (!entry || url != entry->GetURL().spec()) { 92 if (!entry || url != entry->GetURL().spec()) {
93 error_ = ExtensionErrorUtils::FormatErrorMessage(kUrlNotActiveError, url); 93 error_ = ExtensionErrorUtils::FormatErrorMessage(kUrlNotActiveError, url);
94 return false; 94 return false;
95 } 95 }
96 96
97 // Set visibility and broadcast notifications that the UI should be updated. 97 // Set visibility and broadcast notifications that the UI should be updated.
98 page_action->SetAppearance( 98 page_action->SetAppearance(
99 tab_id, enable ? ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE); 99 tab_id, enable ? ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE);
100 page_action->SetTitle(tab_id, title); 100 page_action->SetTitle(tab_id, title);
101 page_action->SetIconIndex(tab_id, icon_id); 101 page_action->SetIconIndex(tab_id, icon_id);
102 contents->extension_tab_helper()->location_bar_controller()->NotifyChange(); 102 extensions::TabHelper::FromWebContents(contents->web_contents())->
103 location_bar_controller()->NotifyChange();
103 104
104 return true; 105 return true;
105 } 106 }
106 107
107 bool EnablePageActionsFunction::RunImpl() { 108 bool EnablePageActionsFunction::RunImpl() {
108 return SetPageActionEnabled(true); 109 return SetPageActionEnabled(true);
109 } 110 }
110 111
111 bool DisablePageActionsFunction::RunImpl() { 112 bool DisablePageActionsFunction::RunImpl() {
112 return SetPageActionEnabled(false); 113 return SetPageActionEnabled(false);
113 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698