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

Side by Side Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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/ui/search/search_tab_helper.h" 5 #include "chrome/browser/ui/search/search_tab_helper.h"
6 6
7 #include "chrome/browser/google/google_util.h" 7 #include "chrome/browser/google/google_util.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/search/search.h" 9 #include "chrome/browser/ui/search/search.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
11 #include "content/public/browser/navigation_controller.h" 11 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/browser/navigation_details.h" 12 #include "content/public/browser/navigation_details.h"
13 #include "content/public/browser/navigation_entry.h" 13 #include "content/public/browser/navigation_entry.h"
14 #include "content/public/browser/notification_service.h" 14 #include "content/public/browser/notification_service.h"
15 #include "content/public/browser/notification_types.h" 15 #include "content/public/browser/notification_types.h"
16 #include "content/public/browser/render_widget_host_view.h" 16 #include "content/public/browser/render_widget_host_view.h"
17 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
18 18
19 int chrome::search::SearchTabHelper::kUserDataKey; 19 DEFINE_WEB_CONTENTS_USER_DATA_KEY(chrome::search::SearchTabHelper)
20 20
21 namespace { 21 namespace {
22 22
23 bool IsNTP(const GURL& url) { 23 bool IsNTP(const GURL& url) {
24 return url.SchemeIs(chrome::kChromeUIScheme) && 24 return url.SchemeIs(chrome::kChromeUIScheme) &&
25 url.host() == chrome::kChromeUINewTabHost; 25 url.host() == chrome::kChromeUINewTabHost;
26 } 26 }
27 27
28 bool IsSearchEnabled(content::WebContents* web_contents) { 28 bool IsSearchEnabled(content::WebContents* web_contents) {
29 Profile* profile = 29 Profile* profile =
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 content::RenderWidgetHost* SearchTabHelper::GetRenderWidgetHost() { 175 content::RenderWidgetHost* SearchTabHelper::GetRenderWidgetHost() {
176 content::RenderWidgetHostView* rwhv = 176 content::RenderWidgetHostView* rwhv =
177 web_contents()->GetRenderWidgetHostView(); 177 web_contents()->GetRenderWidgetHostView();
178 return rwhv ? rwhv->GetRenderWidgetHost() : NULL; 178 return rwhv ? rwhv->GetRenderWidgetHost() : NULL;
179 } 179 }
180 180
181 } // namespace search 181 } // namespace search
182 } // namespace chrome 182 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698