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 "chrome/browser/chromeos/extensions/wallpaper_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_private_api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/window_cycle_controller.h" | 10 #include "ash/wm/window_cycle_controller.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool GetData(int key, const std::string& file_name, std::string* data) { | 83 bool GetData(int key, const std::string& file_name, std::string* data) { |
84 FilePath data_dir; | 84 FilePath data_dir; |
85 CHECK(PathService::Get(key, &data_dir)); | 85 CHECK(PathService::Get(key, &data_dir)); |
86 if (!file_util::DirectoryExists(data_dir) && | 86 if (!file_util::DirectoryExists(data_dir) && |
87 !file_util::CreateDirectory(data_dir)) | 87 !file_util::CreateDirectory(data_dir)) |
88 return false; | 88 return false; |
89 | 89 |
90 FilePath file_path = data_dir.Append(file_name); | 90 FilePath file_path = data_dir.Append(file_name); |
91 | 91 |
92 return !file_util::PathExists(file_path) || | 92 return !file_util::PathExists(file_path) || |
93 (file_util::ReadFileToString(file_path, data) != -1); | 93 !file_util::ReadFileToString(file_path, data); |
94 } | 94 } |
95 | 95 |
96 class WindowStateManager; | 96 class WindowStateManager; |
97 | 97 |
98 // static | 98 // static |
99 WindowStateManager* g_window_state_manager = NULL; | 99 WindowStateManager* g_window_state_manager = NULL; |
100 | 100 |
101 // WindowStateManager remembers which windows have been minimized in order to | 101 // WindowStateManager remembers which windows have been minimized in order to |
102 // restore them when the wallpaper viewer is hidden. | 102 // restore them when the wallpaper viewer is hidden. |
103 class WindowStateManager : public aura::WindowObserver { | 103 class WindowStateManager : public aura::WindowObserver { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 BrowserThread::PostTask( | 560 BrowserThread::PostTask( |
561 BrowserThread::UI, FROM_HERE, | 561 BrowserThread::UI, FROM_HERE, |
562 base::Bind(&WallpaperSaveThumbnailFunction::Success, this)); | 562 base::Bind(&WallpaperSaveThumbnailFunction::Success, this)); |
563 } else { | 563 } else { |
564 BrowserThread::PostTask( | 564 BrowserThread::PostTask( |
565 BrowserThread::UI, FROM_HERE, | 565 BrowserThread::UI, FROM_HERE, |
566 base::Bind(&WallpaperSaveThumbnailFunction::Failure, | 566 base::Bind(&WallpaperSaveThumbnailFunction::Failure, |
567 this, file_name)); | 567 this, file_name)); |
568 } | 568 } |
569 } | 569 } |
OLD | NEW |