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

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

Issue 1254103002: New Task Manager - Phase 1.3.5: Implement Extension Task Providing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Devlin's comments Created 5 years, 4 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
« no previous file with comments | « extensions/browser/extensions_browser_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 #include "extensions/browser/extensions_browser_client.h"
9 10
10 using content::WebContents; 11 using content::WebContents;
11 12
12 namespace extensions { 13 namespace extensions {
13 14
14 namespace { 15 namespace {
15 16
16 const char kViewTypeUserDataKey[] = "ViewTypeUserData"; 17 const char kViewTypeUserDataKey[] = "ViewTypeUserData";
17 18
18 class ViewTypeUserData : public base::SupportsUserData::Data { 19 class ViewTypeUserData : public base::SupportsUserData::Data {
(...skipping 13 matching lines...) Expand all
32 return VIEW_TYPE_INVALID; 33 return VIEW_TYPE_INVALID;
33 34
34 ViewTypeUserData* user_data = static_cast<ViewTypeUserData*>( 35 ViewTypeUserData* user_data = static_cast<ViewTypeUserData*>(
35 tab->GetUserData(&kViewTypeUserDataKey)); 36 tab->GetUserData(&kViewTypeUserDataKey));
36 37
37 return user_data ? user_data->type() : VIEW_TYPE_INVALID; 38 return user_data ? user_data->type() : VIEW_TYPE_INVALID;
38 } 39 }
39 40
40 void SetViewType(WebContents* tab, ViewType type) { 41 void SetViewType(WebContents* tab, ViewType type) {
41 tab->SetUserData(&kViewTypeUserDataKey, new ViewTypeUserData(type)); 42 tab->SetUserData(&kViewTypeUserDataKey, new ViewTypeUserData(type));
43
44 ExtensionsBrowserClient::Get()->AttachExtensionTaskManagerTag(tab, type);
42 } 45 }
43 46
44 } // namespace extensions 47 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extensions_browser_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698