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

Side by Side Diff: chrome/browser/ui/android/infobars/infobar_android.cc

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nib name on mac Created 6 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/android/infobars/infobar_android.h" 5 #include "chrome/browser/ui/android/infobars/infobar_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/android/resource_mapper.h" 10 #include "chrome/browser/android/resource_mapper.h"
11 #include "chrome/browser/infobars/infobar.h"
12 #include "chrome/browser/infobars/infobar_delegate.h"
13 #include "chrome/browser/infobars/infobar_service.h" 11 #include "chrome/browser/infobars/infobar_service.h"
12 #include "components/infobars/core/infobar.h"
13 #include "components/infobars/core/infobar_delegate.h"
14 #include "jni/InfoBar_jni.h" 14 #include "jni/InfoBar_jni.h"
15 15
16 16
17 // InfoBar -------------------------------------------------------------------- 17 // InfoBar --------------------------------------------------------------------
18 18
19 // Static constants defined in infobar.h. We don't really use them for anything 19 // Static constants defined in infobar.h. We don't really use them for anything
20 // but they are required. The values are copied from the GTK implementation. 20 // but they are required. The values are copied from the GTK implementation.
21 const int InfoBar::kSeparatorLineHeight = 1; 21 const int infobars::InfoBar::kSeparatorLineHeight = 1;
22 const int InfoBar::kDefaultArrowTargetHeight = 9; 22 const int infobars::InfoBar::kDefaultArrowTargetHeight = 9;
23 const int InfoBar::kMaximumArrowTargetHeight = 24; 23 const int infobars::InfoBar::kMaximumArrowTargetHeight = 24;
24 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; 24 const int infobars::InfoBar::kDefaultArrowTargetHalfWidth =
25 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; 25 kDefaultArrowTargetHeight;
26 const int InfoBar::kDefaultBarTargetHeight = 36; 26 const int infobars::InfoBar::kMaximumArrowTargetHalfWidth = 14;
27 27 const int infobars::InfoBar::kDefaultBarTargetHeight = 36;
28 28
29 // InfoBarAndroid ------------------------------------------------------------- 29 // InfoBarAndroid -------------------------------------------------------------
30 30
31 InfoBarAndroid::InfoBarAndroid(scoped_ptr<InfoBarDelegate> delegate) 31 InfoBarAndroid::InfoBarAndroid(scoped_ptr<infobars::InfoBarDelegate> delegate)
32 : InfoBar(delegate.Pass()) { 32 : infobars::InfoBar(delegate.Pass()) {
33 } 33 }
34 34
35 InfoBarAndroid::~InfoBarAndroid() { 35 InfoBarAndroid::~InfoBarAndroid() {
36 } 36 }
37 37
38 void InfoBarAndroid::ReassignJavaInfoBar(InfoBarAndroid* replacement) { 38 void InfoBarAndroid::ReassignJavaInfoBar(InfoBarAndroid* replacement) {
39 DCHECK(replacement); 39 DCHECK(replacement);
40 if (!java_info_bar_.is_null()) { 40 if (!java_info_bar_.is_null()) {
41 replacement->set_java_infobar(java_info_bar_); 41 replacement->set_java_infobar(java_info_bar_);
42 java_info_bar_.Reset(); 42 java_info_bar_.Reset();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 int InfoBarAndroid::GetEnumeratedIconId() { 76 int InfoBarAndroid::GetEnumeratedIconId() {
77 return ResourceMapper::MapFromChromiumId(delegate()->GetIconID()); 77 return ResourceMapper::MapFromChromiumId(delegate()->GetIconID());
78 } 78 }
79 79
80 80
81 // Native JNI methods --------------------------------------------------------- 81 // Native JNI methods ---------------------------------------------------------
82 82
83 bool RegisterNativeInfoBar(JNIEnv* env) { 83 bool RegisterNativeInfoBar(JNIEnv* env) {
84 return RegisterNativesImpl(env); 84 return RegisterNativesImpl(env);
85 } 85 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/infobars/infobar_android.h ('k') | chrome/browser/ui/android/infobars/infobar_container_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698