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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_api.cc

Issue 11587006: browser: Move two other functions from browser_finder.h into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/extensions/api/tabs/tabs.cc » ('j') | 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 // Implements the Chrome Extensions Tab Capture API. 5 // Implements the Chrome Extensions Tab Capture API.
6 6
7 #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h" 7 #include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h"
8 8
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (!FeatureSwitch::tab_capture()->IsEnabled()) { 47 if (!FeatureSwitch::tab_capture()->IsEnabled()) {
48 error_ = kPermissionError; 48 error_ = kPermissionError;
49 return false; 49 return false;
50 } 50 }
51 51
52 scoped_ptr<api::tab_capture::Capture::Params> params = 52 scoped_ptr<api::tab_capture::Capture::Params> params =
53 TabCapture::Capture::Params::Create(*args_); 53 TabCapture::Capture::Params::Create(*args_);
54 EXTENSION_FUNCTION_VALIDATE(params.get()); 54 EXTENSION_FUNCTION_VALIDATE(params.get());
55 55
56 // Figure out the active WebContents and retrieve the needed ids. 56 // Figure out the active WebContents and retrieve the needed ids.
57 Browser* target_browser = browser::FindAnyBrowser(profile(), 57 Browser* target_browser = chrome::FindAnyBrowser(profile(),
58 include_incognito(), 58 include_incognito(),
59 chrome::GetActiveDesktop()); 59 chrome::GetActiveDesktop());
60 if (!target_browser) { 60 if (!target_browser) {
61 error_ = kFindingTabError; 61 error_ = kFindingTabError;
62 return false; 62 return false;
63 } 63 }
64 64
65 content::WebContents* target_contents = 65 content::WebContents* target_contents =
66 target_browser->tab_strip_model()->GetActiveWebContents(); 66 target_browser->tab_strip_model()->GetActiveWebContents();
67 if (!target_contents) { 67 if (!target_contents) {
68 error_ = kFindingTabError; 68 error_ = kFindingTabError;
69 return false; 69 return false;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 info->tab_id = it->tab_id; 151 info->tab_id = it->tab_id;
152 info->status = it->status; 152 info->status = it->status;
153 list->Append(info->ToValue().release()); 153 list->Append(info->ToValue().release());
154 } 154 }
155 155
156 SetResult(list); 156 SetResult(list);
157 return true; 157 return true;
158 } 158 }
159 159
160 } // namespace extensions 160 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/extensions/api/tabs/tabs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698