OLD | NEW |
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 "extensions/browser/view_type_utils.h" | 5 #include "extensions/browser/view_type_utils.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
9 | 9 |
10 using content::WebContents; | 10 using content::WebContents; |
(...skipping 23 matching lines...) Expand all Loading... |
34 ViewTypeUserData* user_data = static_cast<ViewTypeUserData*>( | 34 ViewTypeUserData* user_data = static_cast<ViewTypeUserData*>( |
35 tab->GetUserData(&kViewTypeUserDataKey)); | 35 tab->GetUserData(&kViewTypeUserDataKey)); |
36 | 36 |
37 return user_data ? user_data->type() : VIEW_TYPE_INVALID; | 37 return user_data ? user_data->type() : VIEW_TYPE_INVALID; |
38 } | 38 } |
39 | 39 |
40 void SetViewType(WebContents* tab, ViewType type) { | 40 void SetViewType(WebContents* tab, ViewType type) { |
41 tab->SetUserData(&kViewTypeUserDataKey, new ViewTypeUserData(type)); | 41 tab->SetUserData(&kViewTypeUserDataKey, new ViewTypeUserData(type)); |
42 } | 42 } |
43 | 43 |
44 } // namespace chrome | 44 } // namespace extensions |
OLD | NEW |