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

Side by Side Diff: chrome/browser/view_type_utils.cc

Issue 10409088: Get rid of the RenderViewType concept in content, since it was only used by Chrome. Store the enum… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/view_type_utils.h"
6
7 #include "base/lazy_instance.h"
8 #include "base/property_bag.h"
9 #include "content/public/browser/web_contents.h"
10
11 using content::WebContents;
12
13 namespace chrome {
14
15 static base::LazyInstance<base::PropertyAccessor<ViewType> >
16 g_view_type_property_accessor = LAZY_INSTANCE_INITIALIZER;
17
18 base::PropertyAccessor<ViewType>* GetPropertyAccessor() {
19 return g_view_type_property_accessor.Pointer();
20 }
21
22 ViewType GetViewType(WebContents* tab) {
23 if (!tab)
24 return VIEW_TYPE_INVALID;
25 ViewType* type = GetPropertyAccessor()->GetProperty(tab->GetPropertyBag());
26 if (type)
27 return *type;
28 return VIEW_TYPE_INVALID;
29 }
30
31 void SetViewType(WebContents* tab, ViewType type) {
32 GetPropertyAccessor()->SetProperty(tab->GetPropertyBag(), type);
33 }
34
35 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698