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

Side by Side Diff: chrome/browser/importer/importer.h

Issue 6979007: Many fixes to bookmark importing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Happy tests =) Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/importer/importer.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_H_ 5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_H_
6 #define CHROME_BROWSER_IMPORTER_IMPORTER_H_ 6 #define CHROME_BROWSER_IMPORTER_IMPORTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 13 matching lines...) Expand all
24 // And it will be run in file thread by ImporterHost. Since we do async 24 // And it will be run in file thread by ImporterHost. Since we do async
25 // import, the importer should invoke ImporterHost::NotifyImportEnded() to 25 // import, the importer should invoke ImporterHost::NotifyImportEnded() to
26 // notify its host that import stuff have been finished. 26 // notify its host that import stuff have been finished.
27 virtual void StartImport(const importer::SourceProfile& source_profile, 27 virtual void StartImport(const importer::SourceProfile& source_profile,
28 uint16 items, 28 uint16 items,
29 ImporterBridge* bridge) = 0; 29 ImporterBridge* bridge) = 0;
30 30
31 // Cancels the import process. 31 // Cancels the import process.
32 virtual void Cancel(); 32 virtual void Cancel();
33 33
34 void set_import_to_bookmark_bar(bool import_to_bookmark_bar) {
35 import_to_bookmark_bar_ = import_to_bookmark_bar;
36 }
37
38 void set_bookmark_bar_disabled(bool bookmark_bar_disabled) {
39 bookmark_bar_disabled_ = bookmark_bar_disabled;
40 }
41
42 bool bookmark_bar_disabled() { return bookmark_bar_disabled_; }
43 bool cancelled() const { return cancelled_; } 34 bool cancelled() const { return cancelled_; }
44 35
45 protected: 36 protected:
46 friend class base::RefCountedThreadSafe<Importer>; 37 friend class base::RefCountedThreadSafe<Importer>;
47 38
48 Importer(); 39 Importer();
49 virtual ~Importer(); 40 virtual ~Importer();
50 41
51 // Given raw image data, decodes the icon, re-sampling to the correct size as 42 // Given raw image data, decodes the icon, re-sampling to the correct size as
52 // necessary, and re-encodes as PNG data in the given output vector. Returns 43 // necessary, and re-encodes as PNG data in the given output vector. Returns
53 // true on success. 44 // true on success.
54 static bool ReencodeFavicon(const unsigned char* src_data, 45 static bool ReencodeFavicon(const unsigned char* src_data,
55 size_t src_len, 46 size_t src_len,
56 std::vector<unsigned char>* png_data); 47 std::vector<unsigned char>* png_data);
57 48
58 bool import_to_bookmark_bar() const { return import_to_bookmark_bar_; }
59
60 scoped_refptr<ImporterBridge> bridge_; 49 scoped_refptr<ImporterBridge> bridge_;
61 50
62 private: 51 private:
63 // True if the importer is created in the first run UI.
64 bool import_to_bookmark_bar_;
65
66 // Whether bookmark bar is disabled (not shown) for importer. This is set
67 // true during first run to prevent out of process bookmark importer from
68 // updating bookmark bar settings.
69 bool bookmark_bar_disabled_;
70
71 // True if the caller cancels the import process. 52 // True if the caller cancels the import process.
72 bool cancelled_; 53 bool cancelled_;
73 54
74 DISALLOW_COPY_AND_ASSIGN(Importer); 55 DISALLOW_COPY_AND_ASSIGN(Importer);
75 }; 56 };
76 57
77 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_H_ 58 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/importer/importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698