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

Side by Side Diff: content/browser/power_save_blocker_win.cc

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « content/browser/plugin_service_impl.cc ('k') | content/browser/ppapi_plugin_process_host.h » ('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 #include "content/browser/power_save_blocker_impl.h" 5 #include "content/browser/power_save_blocker_impl.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 21 matching lines...) Expand all
32 if (!PowerCreateRequestFn || !PowerSetRequestFn) { 32 if (!PowerCreateRequestFn || !PowerSetRequestFn) {
33 HMODULE module = GetModuleHandle(L"kernel32.dll"); 33 HMODULE module = GetModuleHandle(L"kernel32.dll");
34 PowerCreateRequestFn = reinterpret_cast<PowerCreateRequestPtr>( 34 PowerCreateRequestFn = reinterpret_cast<PowerCreateRequestPtr>(
35 GetProcAddress(module, "PowerCreateRequest")); 35 GetProcAddress(module, "PowerCreateRequest"));
36 PowerSetRequestFn = reinterpret_cast<PowerSetRequestPtr>( 36 PowerSetRequestFn = reinterpret_cast<PowerSetRequestPtr>(
37 GetProcAddress(module, "PowerSetRequest")); 37 GetProcAddress(module, "PowerSetRequest"));
38 38
39 if (!PowerCreateRequestFn || !PowerSetRequestFn) 39 if (!PowerCreateRequestFn || !PowerSetRequestFn)
40 return INVALID_HANDLE_VALUE; 40 return INVALID_HANDLE_VALUE;
41 } 41 }
42 string16 wide_reason = ASCIIToUTF16(reason); 42 base::string16 wide_reason = ASCIIToUTF16(reason);
43 REASON_CONTEXT context = {0}; 43 REASON_CONTEXT context = {0};
44 context.Version = POWER_REQUEST_CONTEXT_VERSION; 44 context.Version = POWER_REQUEST_CONTEXT_VERSION;
45 context.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING; 45 context.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING;
46 context.Reason.SimpleReasonString = const_cast<wchar_t*>(wide_reason.c_str()); 46 context.Reason.SimpleReasonString = const_cast<wchar_t*>(wide_reason.c_str());
47 47
48 base::win::ScopedHandle handle(PowerCreateRequestFn(&context)); 48 base::win::ScopedHandle handle(PowerCreateRequestFn(&context));
49 if (!handle.IsValid()) 49 if (!handle.IsValid())
50 return INVALID_HANDLE_VALUE; 50 return INVALID_HANDLE_VALUE;
51 51
52 if (PowerSetRequestFn(handle, type)) 52 if (PowerSetRequestFn(handle, type))
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 base::Bind(&Delegate::ApplyBlock, delegate_)); 165 base::Bind(&Delegate::ApplyBlock, delegate_));
166 } 166 }
167 167
168 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { 168 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() {
169 BrowserThread::PostTask( 169 BrowserThread::PostTask(
170 BrowserThread::UI, FROM_HERE, 170 BrowserThread::UI, FROM_HERE,
171 base::Bind(&Delegate::RemoveBlock, delegate_)); 171 base::Bind(&Delegate::RemoveBlock, delegate_));
172 } 172 }
173 173
174 } // namespace content 174 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_service_impl.cc ('k') | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698